subsonic3

SubSonic Transactions - Inserting to a second table with the return identity from first table

I am using the code below to update a second table (Info2) with the identity used from the first table (info2.Id = info.Id;). When the second save is carried out (info2.Save()) I get the error: "There is already an open DataReader associated with this Command which must be closed first.". Can anyone see what I may be doing wrong. SubSon...

subsonic 3 oracle

I have a couple of question's regarding the following project. *Scott, Recently some developers have teamed-up to offer Oracle support (using Oracle's ODP.NET) for Subsonic 3.x, using the T4 Visual Studio template database provider system. Please search Github.com for Oracle/Subsonic, or my link, http://github.com/mabraham1...

Recommendations for unit testing when using Subsonic 3.0 LINQ templates

I have started using Subsonic for a side project and have been loving using it. Simply a blast. I started off wanting to use the LINQ T4 Templates but have since switched to the ActiveRecord templates due to testability. It is very clear how to write unit tests using the active record templates but for the LINQ templates there is no clea...

Increase sql timeout subsonic3

Is there a way to increase the sql timeout in subsonic 3 when using LINQ? Example code var db = new Edumatic3DB(); var treeNodes = from tn in db.TreeNodes join ts in db.TreeStructures on tn.TreeStructureId equals ts.TreeStructureId where ts.LeftValue > treeStructure.LeftValu...

SubSonic 3 How do i link class/tables?

While using SubSonic 3 i wrote the below. I thought i would get user_ref would be a column with name_list as its foriegn key. My database ended up with just id and link with only the image_list table. How can i have user_ref use name_list as its foriegn key and have both tables in the database? class image_list { public long ID { g...

Subsonic adding a DB provider for Simple Repository

Hey guys, I was wondering--what part of Subsonic 3 needs to be modified to support a different database under a Simple Repository scenario? I haven't found any documentation on this point. Subsonic 3 seems to be all about the T4 templates but when I check out the Subsonic project sources I don't see any T4 templates in there...so wher...

Subsonic and RTF

I was having some doubts please. I was trying very hard to put the values of a RTF edit box in my database [SQLServer 2005] but i was not able to do that . Somebody in here knows why ? Oh and by the way, my datatype in SQL Server is nvarchar(max) I was wondering if Subsonic supported RTF texts. I am not sure, but still sorry for being...

Where is the CleanUp method?

Hi. I'm working fine with Subsonic 3 and the templates until november 2009. Now I'm geting the source directly from Git, but the ActiveRecord template doesn't generates correctly anymore. In the line 334 of the ActiveRecord template for SQLite: return from items in repo.GetAll() where items.<#=CleanUp(fk.OtherColumn)#> == <#=Clea...

C# SubSonic SQLite: NullReferenceException on Update

I have seen some older posts similar to this, but I seem to be getting this using SQLite rather than SQL Server. I think the version is 3.0.0.3. I am doing an update on an object, in this particular case, the object is passed into a form and saved there...Save() method to repository is on the same class. I have checked the properties b...

Subsonic 3 ActiveRecord Setup() behavior

Been a long time user of Subsonic 2.x and have used 3.x a bit, but I've recently started transitioning our use of SS from using repositories to ActiveRecord instead. I'm currently stumbling on some of our unit tests and I wonder if it's perhaps because I'm misunderstanding the intent of the Setup() method. Alas, the only documentation ...

SubSonic SimpleRepository - Foreign Objects

SubSonic SimpleRepository doesn't seem to have a lot of support for foreign relations. How can I have foreign relationships in my code models that persist and load from the database naturally? ...

Subsonic not setting IsLoaded on Add?

Hi, if dupe question sorry tight deadline and didn't find right away. Seems when I add a new record via Subsonic v3 it does get added but then when I try to update a value the update doesn't happen as the _isLoaded is false. user.username = "batman"; user.Add(); address.address1 = "1234 Anyhwere St"; address.Add(); user.AddressID = a...

SubSonic 3.0 NullReferenceException when i try to create a query

Hi guys, i have 2 tables - products and categories. Each product belong to 1 category. When i delete category i need to delete all corresponding products, also i need to do that in transaction. So far i have this code: var batch = new BatchQuery(); var qryDelete = new SubSonic.Query.Delete<product>() .Where(productTable...

Subsonic 3 LeftOuterJoin

I have a problem. I want to create sql question select * from Firma left outer join FirmaAdres on FirmaAdres.Typ = 1 and FirmaAdres.FirmaID = Firma.ID in subsonic I have written SelectColumns("Firma.*").From().LeftOuterJoin(FirmaTable.IDColumn, FirmaAdresTable.FirmaIDColumn).And(FirmaAdresTable.AdresTypIDColumn).IsEqualTo(1) When I...

ElementAt() doesn't work in Linq to SubSonic

I have this query: var iterator = criteria.binaryAssetBranchNodeIds.GetEnumerator(); iterator.MoveNext(); var binaryAssetStructures = from bas in db.BinaryAssetStructures where bas.BinaryAssetStructureId == iterator.Current select bas; When I iterate over the binaryAssetStruc...

Why is GetPaged() Executing two database calls?

I'm a bit new to subsonic (i.e. evaluating 3.0.0.3) and have come across a strange behavior in GetPaged(int pageIndex, int pageSize). When I execute the method it does two SQL calls. Any ideas why ? Details Lets say I have a "Cultures" table with 200 rows. In my code I do something like ... var sonicCollection = from c in RTE.Cultu...

Subsonic 3.0 Bug?

Hi, I have a table named "data_buckets" and a column in that table named "data_bucket". When I buid the activerecord.cs, subsonic created a class name "data_bucket" (extending IActiveRecord) for the table and obviously a conflict will arise when you try to access the field "data_bucket". Is it a known issue? Is there any workaround with...

Subsonic 3.0 - Prefix all column names

Hi, Problem. Subsonic 3 build against an existing, medium sized DB Lots of columns, some badly named so conflicting against reserved words, Subsonic functions etc. Want to be able to prefix all column names (not tables) with something, eg. 'c' for column so that the appear together in intellisense drop down and solve naming issues in...

Subsonic 3.0 missing output parameter/default parameter support in SQL Server?

I have a stored proc: CREATE PROCEDURE MyProc ( @P1 uniqueidentifier, @P2 int = NULL output, @P3 int = NULL output ) The signature on the C# side should be (Guid P1, int? P2, int? P3) I would think. But it's not, it's just (Guid,int,int). Furthermore, the output params are not created as output params, they're just straight "AddPara...

The type or namespace name 'EmployeesTable' could not be found

Hi, Just testing Subsonic 3 (ActiveRecord) with Northwind on SQL server. Have a reference to subsonic dll, connection string is definately OK, and amended and copied files to Model folder. When I build I get 13 errors (as per title) corresponding to each table in context.cs. Tried this as both a MVC and normal Web Application project ...