subsonic

SubSonic Controller

What's the use of the controllers in SubSonic? thx, Lieven Cardoen aka Johlero ...

SubSonic Collection Top 1

Is there way in next piece of code to only get the first record? Dal.TreeHtmlExportsCollection treeHtmlExportsCollection = new Dal.TreeHtmlExportsCollection().Where(Dal.TreeHtmlExports.Columns.TreeId, treeId). OrderByDesc(Dal.TreeHtmlExports.Columns.DateCreated).Load(); ...

SubSonic Problem Stored Procedures

In the last two days I refactored a lot of Stored Procedures. Today I ran SubSonic and tried the application and I get this error that's driving me crazy: Could not locate entry in sysdatabases for database 'sp'. No entry found with that name. Make sure that the name is entered correctly. : at System.Data.SqlClient.SqlConnection.OnEr...

Class usage in ORM based projects

This question is about "best use" scenarios in projects with ORMs like NHibernate, Subsonic, Linq2SQL, etc... All of these tools generate basic entity classes, some with attributes, others without. Do people use these classes as their business classes? Or is there wholesale copying of data from ORM generated classes to manually create...

SubSonic "Version" fails due to missing dependencies

I am using SubSonic 2.1 Final but having problems running "Version" with the SubCommander. I think this problem began when I installed SQL Server 2008 on my local machine and removed 2005. This is the error I get: ERROR: Trying to execute Version Error Message: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft...

Lambdas with captured variables.

Consider the following line of code: private void DoThis() { int i = 5; var repo = new ReportsRepository<RptCriteriaHint>(); // This does NOT work var query1 = repo.Find(x => x.CriteriaTypeID == i).ToList<RptCriteriaHint>(); // This DOES work var query1 = repo.Find(x => x.CriteriaTypeID == 5).ToList<RptCr...

How to get more ways of interrogating my data source from subsonic

In the below link, Linq-To-Sql produces a range of methods to get data back based on various real-world needs (e.g. recent topics, etc). How can I get Subsonic to produce me a set of classes which would interrogate and return data back from my data source in such a way? I get classes which really just present CRUD ops. Thanks ...

Inserting a new record pattern in SubSonic 3

I'm trying out the new SubSonic 3 preview, but I'm not sure about the patterns I should be using for the basic CRUD operations in my MVC project. I'm trying to keep as much of my data logic in my models, so I added some static CRUD methods to each model's partial class. For example, let's say I have a configuration table, which should ...

.netTiers vs SubSonic

I had some time this afternoon to run a head to head comparison between netTiers and SubSonic. I used code generated using SubStage (part of the SubSonic 2.1 release) and I used RepositoryRecord as my base class. I ran the same test against the same database using code generated by .netTiers 2.2 The test was a derivative of the one th...

Automatically update AddedBy and EditedBy fields in SubSonic

I have a data model that includes common columns like addedBy, editedby (user), addedDate, editedDate. Is there a setting I can use in SubSonic 2.1 that will automatically update these fields appropriately instead of having to explicitly specify in every update? ...

How do you avoid the n+1 problem with SubSonic?

Ayende has a blog post detailing how to combat the "n+1" problem in nHibernate. In essence, the problem is this: Assume you have two tables, "BlogPosts" and "Comments" with a one-to-many relationship between them (i.e. each BlogPost can have multiple Comments). Now, let's say you want to execute the following nested for loop: foreach...

Using FreeText with SubSonic

Is there a general consensus on how to use SQL 2005's full text search with SubSonic? I know that I can use the InlineQuery and get an IDataReader, but is this the only way to do this? Also, how would I incorporate paging into it? Would I have to write the paging myself in the InlineQuery? What I would really like to do is something ...

Why can BuildProvider be used only with ASP.NET website projects?

I was going to try Subsonic, you can generate DAL with buildProvider element in an ASP.NET website project. But I get curious why Web applications or windows applications do not support BuildProvider. PS: I know for Subsonic there is one other option to use it with other than BuildProvider, but I just get curious. ...

how can we integrate jquery autocomplete using asp.net, webservie and sql database

hi i am trying to implement the code given for "jQuery Autocomplete and ASP.NET" but unable to integrate it cause you are using subsonic to query database so can you tell me how to query sqldatabase and bind the query result to the plugin from webservice in asp.net using C#. please its urgent. ...

How do I update a change using SubSonic and MySQL

I was trying to TDD using SubSonic 2.1, MySQL and C# and when I got to testing updating an existing record using the code below, public void Test2() { User.Insert("jmarcus1", "jmarcus1", "jackass", "marcus", 3, false); User users = new User(); int ulevel = 1; User.Update(2, "jmarcus1", "jmarcus1", "jackass", "marcus", ul...

SubSonic data layer that returns POCOs instead of SubSonic's ActiveRecord objects

I want to use SubSonic (2.2) in an application I'm building because I like its simplicity and it handles any type of query I can foresee needing. At the same time, I want to keep the upper layers of my application de-coupled from the Subsonic Types. I want to return just Plain Old C# Objects and also pass in POCOs to be saved. But here'...

How to get into SubSonic?

Hi anybody, a month ago i searched for some tools that will generate c# classes out for my sql database/tables. so i don't have to write DAL classes manually and to save a lot of time. i came across "ORM" and subsonic. i watched the webcasts on the homepage http://subsonicproject.com/ and was pretty impressed by it. but i am still miss...

What are the differences and pros and cons of these ORM tools/technologies?

Duplicate: http://stackoverflow.com/questions/66156/whose-data-access-layer-do-you-use-for-net http://stackoverflow.com/questions/380620/what-object-mapper-solution-would-you-recommend-for-net-closed http://stackoverflow.com/questions/217655/using-entity-framework-entities-as-business-objects http://stackoverflow.com/questions/146087/...

How do you use Castle Validator with Subsonic generated classes?

Castle Validator uses attributes to specify validation rules. How can you hook these up with Subsonic's generated classes (or any classes where you can't define the attributes on)? Is there a way to programatically specify validation rules without using the attribute method? ...

Has anyone used any .Net code generation frameworks in Mono? (Subsonic, .netTiers, etc..)

Mono appears to have really come a log way since the last time I really used it. I'm interested in doing some ASP.Net development using Mono. I have used .netTiers/CodeSmith at work and really enjoy the speed with which code generation gives you a clean working data access layer. The question is has anybody used any code generation wi...