Search Results

Search found 186 results on 8 pages for 'subsonic'.

Page 5/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • Subsonic custom mapping of objects to tables

    - by codekaizen
    Geeting, I'm using Compact Framework 3.5 and have tenatively settled on a custom build of Subsonic 3.0 to do data access. The trouble is that I am used to developing model-first but am also interested in keeping control of my DB schema. Therefore, neither ActiveRecord or Repository appears to meet my needs, and I want to use my existing POCO model and map it to my existing tables. I'm used to doing this via NHibernate and Entity Framework. After some investigation, it appears that I might be able to author a custom QueryMapping to give me the custom mapping I want. Before I start down this path, however, I'd like to see some kind of example of this being done. I can't seem to find any on the web, and wonder if anyone could give input on experience with Subsonic, model-first and a custom Table-per-Type and Table-per-Hierarchy mapping.

    Read the article

  • calculate distance with linq or subsonic C# MVC

    - by minus4
    i have this MySQL statement from a search page, the user enters there postcode and it finds the nearest stiocklist within 15 MIles of the entered postcode. SELECT * , ( ( ACOS( SIN( "+SENTLNG +" * PI( ) /180 ) * SIN( s_lat * PI( ) /180 ) + COS( " + SENTLNG +" * PI( ) /180 ) * COS( s_lat * PI( ) /180 ) * COS( ( " + SENTLANG + " - s_lng ) * PI( ) /180 ) ) *180 / PI( ) ) *60 * 1.1515 ) AS distance_miles FROM new_stockists WHERE s_lat IS NOT NULL HAVING distance_miles <15 ORDER BY distance_miles ASC LIMIT 0 , 15 but now i am using linq and subsonic and not got a clue how do do this in linq or subsonic your help would be much appreciated, please also not that i have to sent in a dynamic from address, thats the postcode mentioned at the top of the page, i do a call to google to get then lng and lat from them for the postcode given.

    Read the article

  • Subsonic 3 : get only certain columns

    - by CTGA
    Hello, I use : Subsonic 3, SQL Server 2008, Json.Net Here is my problem : I have a house table with id,lot number, address, location, ownerid and an owner table with id,name, description. I'd like to get only the owner name and address of house where location is "San Francisco". How can I do this with Subsonic? My problem is I can only get a typed list or a datareader, I don't understand how to only get an array or a simple list. What is the best solution? Create a custom class ? Create a View ? Anything else ? My aim is to then serialize the data to send it back to my application, but serialization is seriously long because of the numerous relationships (My example here is simplified, there are indeed : house - owner - city - country etc.), whereas I need only 2 fields... Thank you

    Read the article

  • calculate distance with linq or subsonic

    - by minus4
    i have this MySQL statement from a search page, the user enters there postcode and it finds the nearest stiocklist within 15 MIles of the entered postcode. SELECT * , ( ( ACOS( SIN( "+SENTLNG +" * PI( ) /180 ) * SIN( s_lat * PI( ) /180 ) + COS( " + SENTLNG +" * PI( ) /180 ) * COS( s_lat * PI( ) /180 ) * COS( ( " + SENTLANG + " - s_lng ) * PI( ) /180 ) ) *180 / PI( ) ) *60 * 1.1515 ) AS distance_miles FROM new_stockists WHERE s_lat IS NOT NULL HAVING distance_miles <15 ORDER BY distance_miles ASC LIMIT 0 , 15 but now i am using linq and subsonic and not got a clue how do do this in linq or subsonic your help would be much appreciated, please also not that i have to sent in a dynamic from address, thats the postcode mentioned at the top of the page, i do a call to google to get then lng and lat from them for the postcode given.

    Read the article

  • Injecting Subsonic SimpleRepository class to controller

    - by ryudice
    Hi, I'm tryingot get started with IoC, I have an MVC project in which is use subsonic, I'm trying to inject subsonic simplerepository to my controllers but I'm getting this error: StructureMap Exception Code: 205 Missing requested Instance property "connectionStringName" for InstanceKey "60b735fb-0a7f-4eb4-be04-635f6f32233d" Here is my registry class: public class RepositoryRegistry : Registry { protected override void configure() { ForRequestedType<IRepository>().TheDefault.Is.OfConcreteType(typeof(SimpleRepository)); } } And here is my controller factory: public class StoreControllerFactory: DefaultControllerFactory { protected override IController GetControllerInstance(Type controllerType) { IController result = null; if (controllerType!=null) { result = ObjectFactory.GetInstance(controllerType) as Controller; } return result; } } And this is how I configure StructureMap: protected void Application_Start() { RegisterRoutes(RouteTable.Routes); ObjectFactory.Initialize(x=> { x.AddRegistry(new RepositoryRegistry()); }); ControllerBuilder.Current.SetControllerFactory(new StoreControllerFactory()); var sparkSettings = new SparkSettings().SetDebug(true).AddNamespace("System.Web.Mvc.Html"); ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new SparkViewFactory(sparkSettings)); } Any help would be appreciated! Thanks!

    Read the article

  • Not getting key value from Identity column back after inserting new row with SubSonic ActiveRecord

    - by mikedevenney
    I'm sure I'm missing the obvious answer here, but could use a hand. I'm new to SubSonic and using version 3. I've got myself to the point of being able to query and insert, but I'm stuck with how I would get the value of the identity column back after my insert. I saw another post that mentioned Linq Templates. I'm not using those (at least I don't think I am...?) TIA ... UPDATE ... So I've been debugging through my code watching how the SubSonic code works and I found where the indentity column is being ignored. I use int as the datatype for my ID columns in the database and set them as identity. Since int is a non-nullable data type in c# the logical test in the Add method (public void Add(IDataProvider provider)) that checks if there is a value in the key column by doing a (key==null) could be the issue. The code that gets the new value for the identity field is in the 'true path', since an int can't be null and I use ints as my identity column data types this test will never pass. The ID field for my object has a 0 in it that I didn't put there. I assume it's set during the initialization of the object. Am I off base here? Is the answer to change my data types in the database? Another question (more a curiosity). I noticed that some of the properties in the generated classes are declared with a ? after the datatype. I'm not familiar with this declaration construct... what gives? There are some declared as an int (non key fields) and others that are declared as int? (key fields). Does this have something to do with how they're treated at initialization? Any help is appreciated! --BUMP--

    Read the article

  • Subsonic 3 LINQ vs LINQ to SQL

    - by Jamil
    Hi, I am using SQL Server 2005 in a project. I have to decide about datalayer. I would like to use LINQ in my project. I saw SubSonic 3 supporting LINQ and I also have option for LINQ to SQL, because i can have typed lists from LINQ to SQL. I am wondering what is different between LINQ to SQL and Subsoinc 3 LINQ, Which is beneficial? Thanks! JAMIL

    Read the article

  • SubSonic 3 LeftOuterJoin

    - by michaelpearce
    I have read in this forum that left outer join syntax is not supported by subsonic in an answer to a question on the topic by "Apocatastasis". I have the same issue in that when I create a query using the .LeftOuterJoin the resulting sql has an inner join rather than a left outer join. Can someone please confirm that LeftOuterJoin is indeed not supported and, if that is the case, why is it included in the active record syntax? Thanks Michael

    Read the article

  • help req for subsonic

    - by Muhammad Afaq Toufiq
    i m using subsonic with sqlserver its working fine. now my boss say donnt use sqlserver use Oracle database in app config For sqlserver -- now wat changes for oracle database req in app.cof ??? plz help me thanx in advance.

    Read the article

  • Where is SubSonicCentral for SubSonic 3.0

    - by silverfox1948
    I used subsoniccentral for pre-building my access code using SubSonic 2.x. My site works in medium trust. I'd like to upgrade to 3.0, but when downloading the binaries and the source, I don't see anything related to subsoniccentral. Is it now deprecated? Or can I just use the old one with the new binaries?

    Read the article

  • Lambda Contains in SimpleRepository.Find

    - by Anton
    In SubSonic 3.04's SimpleRepository, I cannot seem to perform a Contains operation within a lambda expression. Here's a trivial example: SimpleRepository repo = new SimpleRepository("ConnectionString"); List<int> userIds = new List<int>(); userIds.Add(1); userIds.Add(3); List<User> users = repo.Find<User>(x => userIds.Contains(x.Id)).ToList(); I get the error message: variable 'x' of type 'User' referenced from scope '', but it is not defined Am I missing something here, or does SubSonic not support Contains in lambda expressions? If not, how would this be done?

    Read the article

  • SubSonic 2.2 missing stored procedures in StoredProcedures.cs when generated with sonic.exe

    - by Mark
    We are trying to move from SubSonic 2.0.3 to 2.2 (not using .NET 3.5). When we regenerate the project using SubCommander\sonic.exe and try to compile we get some errors reporting missing members (which should have been automatically generated based on the stored procedures we have). On closer inspection it looks like my StoredProcedures.cs file is missing some (not all) automatically generated methods for my classes. As an example, I have 2 procs: [dbo]._ClassA_Func1 [dbo]._ClassA_Func2 Only one of these is being generated in the StoredProcedures.cs file. I have checked the permissions of both procs using fn_my_permissions and they seem identical. Does anyone have any ideas on what I can check? Thanks -- Mark

    Read the article

  • Subsonic 3.0 Query limit with MySQL c#.net LinQ

    - by omegawkd
    Hello, a quick question which may or may not be easily answered. Currently, in order to return a limited result set of data to my calling reference using SubSonic I use a similar function as below: _DataSet = from CatSet in t2_aspnet_shopping_item_category.All() join CatProdAssignedLink in t2_aspnet_shopping_link_categoryproduct.All() on CatSet.CategoryID equals CatProdAssignedLink.CategoryID join ProdSet in t2_aspnet_shopping_item_product.All() on CatProdAssignedLink.ProductID equals ProdSet.ProductID where ProdSet.ProductID == __ProductID orderby CatProdAssignedLink.LinkID ascending select CatSet; and select the first item from the data set. Is there a way to limit the lookup initially to a certain amount of rows? I'm using MySQL as the base database.

    Read the article

  • Subsonic 3 Simple Repository And Transactions

    - by ChrisKolenko
    Hey everyone, So this is what I have so far. Am I doing something wrong or is there a bug in 3.0.0.3? var Repository = new SimpleRepository("DBConnectionName"); using (TransactionScope ts = new TransactionScope()) { using (SharedDbConnectionScope scs = new SharedDbConnectionScope("connstring", "providerName")) { try { for (int i = 0; i < 5; i++) { Supplier s = new Supplier(); s.SupplierCode = i.ToString(); s.SupplierName = i.ToString(); Repository.Add<Supplier>(s); } ts.Complete(); } catch { } } } I'm getting an error in SubSonic DbDataProvider public DbConnection CurrentSharedConnection { get { return __sharedConnection; } protected set { if(value == null) { __sharedConnection.Dispose(); etc.. __sharedConnection == null :( Object Null Reference Exception :(

    Read the article

  • Setting up Subsonic 3.0 on a ASP.NET web application on Visual Studio 2008

    - by Rob Paul
    I followed the steps on this tutorial video by at subsonic website. Everything seems to be self explanatory but when I copy the .tt files into my Visual Studio nothing happens. I have read other question relating to this problem on this website but they don't seem to fix this problem. I also went into the regedit to find out the generator key for .tt files and it is properly set. This is not a visual studio express or anything but a professional edition also I am trying to build a ASP.net web application and not a MVC application like the demo. Any help will be greatly appreciated. Thank You

    Read the article

  • Change connection on the fly

    - by aron
    Hello, I have a SQL server with 50 databases. Each one has the exact same schema. I used the awesome Subsonic 2.2 create the DAL based on one of them. I need to loop though a list of database names and connect to each one and perform an update one at a time. If there a way to alter how subsonic uses the connection string. I believe I would need to store the connection string in memory that way it can keep changing. Is this possible? I tried doing a ConfigurationManager.ConnectionStrings["theConnStrName"].ConnectionString = updated-connection-string-here; .. but that did not work thanks!

    Read the article

  • SubSonic 3 issue creating List<>

    - by Brian Cochran
    I have an application that requires we use distinct user connection strings per user. We are trying to upgrade from SubSonic 2.x to 3.0. I'm running into issues with trying to create a List< of objects. When I try to create a List like this: List<table_name> oList = table_name.All().Where(tn => tn.table_id == TableId).ToList(); I get the error "Connection string 'ConnectionStringName' does not exist." So, I try to create the List< like this: List<table_name> oList = table_name.All(sConnectionString, "System.Data.SqlClient").Where(tn => tn.table_id == TableId).ToList(); I get the error "The name 'table_name' does not exist in the current context." I'm using SQL Server, and the sConnectionString is definitely verified to be a good connection string, and the table_name is a table in the database. What am I doing wrong?

    Read the article

  • Subsonic 3, MySql, won't update record.

    - by Warspawn
    [WebMethod] public string GetAuthToken(string username, string password) { var db = new LogicDB(); //var results = from u in db.Users // where u.Username == username && u.Password == password // select u; User u = db.Select .From<User>() .Where(UsersTable.UsernameColumn).IsEqualTo(username) .And(UsersTable.PasswordColumn).IsEqualTo(password) .ExecuteSingle<User>(); if (u == null) { return "{'success': false, 'reason': 'Invalid username and/or password.'}"; } else { // really there should only be one match... Guid code = Guid.NewGuid(); u.Securitycode = code.ToString(); u.Securityexp = System.DateTime.Now.AddHours(24); //u.Save(db.Provider); return "{'id':'" + u.Id.ToString() + "', 'code':'" + code.ToString() + "', 'exp':'" + u.Securityexp.ToString() + "'}" + "\n\n<br/><br/>" + u.GetDirtyColumns().ToArray().ToString(); } } When I run that, I keep getting: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. This is when u.Save(db.Provider); is uncommented. And happens even with just u.Save(); or using the linq query above results instead.

    Read the article

  • return distinct records using subsonic 3 query and VB

    - by HR
    I have been having issues trying to return distinct records from a subsonic3 query using VB. My base query looks like so: Dim q As New [Select]("Region") q.From("StoreLocation") q.Where("State").IsEqualTo(ddlState.SelectedValue) q.OrderAsc("Region") This returns duplicates. How can I add a distinct clause in this to return distinct records? I have been trying to place around with Contraints, but to no avail. Thanks in advance HR

    Read the article

  • Failed to resolve include text for file:SQLServer.ttinclude

    - by bigred
    I updated to the version 3.0.0.3. Dragged the new ActiveRecord directory in VS08, and added the newer dll. I'm not sure whats going on yet. When I try to compile the project I get that error. My SVN server just lost my old version, so I'll have to download the older Subsonic version and see if that fixes the problem. I have no clue what I did wrong in the configuration as I updated to 3.0.0.3. (still a new users so I couldn't post a photo, but here a link to the error) link text

    Read the article

  • Subsonic Simple Repo for high volume site

    - by kjgilla
    Simple Repo has given me a competitive edge in my consulting. I can finish projects much faster than I could in the "cmd.Parameters.Add(param)" days. As things progress on this end im getting into higher volume sites and wondering if Simple Repo is still the way to go. Im wondering what people's experiences have been putting SR into production vs. NHibernate. Any tips or tricks for using SR in production.

    Read the article

  • Table and Column names causing problems

    - by craig
    I have an issue when the T4 linq templates generate the classes for my MySql db using subsonic 3. It looks like one of our table names "operator" is causing problems in the Context.cs generated class. In the following line of code in Context.cs Visual Studio sees <operator> as a c# operator and generates a compilation error of "Type expected" public Query<operator> operators { get; set; } Is there anyway I can work around this without having to rename my database table and column names? For example hard coding something in Settings.ttinclude to use or map different names to specific db tables and columns?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >