subsonic3

Help with Subsonic3 ActiveRecord LINQ query

I have the following subsonic entities TInvoiceHeader TAccountAssociation How can I achieve the following in LINQ (subsonic) SELECT * from TInvoiceHeader WHERE custid IN (SELECT custid FROM TAccountAssociation WHERE username = 'a') I need to bind the results to a GridView. Update: I tried Dim accounts As List(Of TAccountA...

SQL Server lock/hang issue

Hi, I'm using SQL Server 2008 on Windows Server 2008 R2, all sp'd up. I'm getting occasional issues with SQL Server hanging with the CPU usage on 100% on our live server. It seems all the wait time on SQL Sever when this happens is given to SOS_SCHEDULER_YIELD. Here is the Stored Proc that causes the hang. I've added the "WITH (NOLOCK...

Subsonic ignoring TimeSpan property

For some reason the TimeSpan property on my class is not being persisted into the database by Subsonic it is simply being ignored!? All other properties are being saved OK. I am using SimpleRepository and RunMigrations, Subsonic v3.0.0.3. public TimeSpan Time { get; set; } Are TimeSpans not supported? ...

Why is SubSonic and ActiveRecord throwing an exception when updating a record? (Take 2)

I am experiencing the same error and stack trace as this question. However, I am using the latest code from github as of today (6/11/2010) and I am not having the compilation problems mentioned in the other answer. Other differences from the other poster: My class looks like this: public class ActiveRecordClass1 { private List<A...

Where is SubSonicCentral for SubSonic 3.0

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? ...

Subsonic3 pre-generate code files

I need to pre-generate my active record files, rather than have subsonic build them dynamically. I used to be able to do this using SubSonicCentral in SubSonic 2.x. How do I do this in SubSonic 3? I don't see a generator executable when I download the 3.0.0.4 zip file. ...

Subsonic updates multiple rows instead of 1 ????

Subsonic 3.0 is updating multiple rows instead of just the one it's supposed to DB Table is defined as follows - Col1 int NOT NULL Col2 Text NOT NULL Col3 INT NOT NULL ColX NTEXT COLY NTEXT Primary Key = Col1 + Col2 + Col3 .... the select expr is as follows myTable a = myTable.SingleOrDefault( x => x.Col1 = 1 && x.Col2 = 'a...

SubSonic 3.0 LINQ Parameter Name Mismatch (Must Declare Scalar...)

I love SubSonic, but it continues to bite me in the @$$. I have bumped into LINQ projection problems that I have been able to work around but this latest error that seems to have "appeared" when I added a column to the insert list. For the sake of brevity I am not including the entire generated class here, but the relevant pieces are: ...

Subsonic 3 LINQ Projection issue, fixed or no?

I'm currently experiencing the issue mentioned here (and several other places): http://stackoverflow.com/questions/1105052/subsonic-3-linq-projection-issue This is occurring using the 3.0.0.4 release package, and it also occurs when I grab the latest from GitHub and build it. I am using the LINQ Templates. I have this code: v...

Getting error when using the SubSonicRepository update method - SubSonic 3.4

Here is sample code which I used to update customer table. public void UpdateCustomer() { SAPDB db = new SAPDB(); SubSonicRepository<Customer> ssr = new SubSonicRepository<Customer>(db); Customer customer = new Customer(); customer.ID = 5; customer.CustomerName = "John"; int val = ssr.Update(customer); } Please le...

Failed to batch insert in Subsonic3 with error "Must declare the scalar variable..."

I have met a problem about inserting multiple rows in a batch with Subsonic3. My development environment includes: 1. Visual Studio 2010, but use .NET 3.5 2. Active Record Mode in SubSonic 3.0.0.4 3. SQL Server 2005 express 4. Northwind sample database I am using Active Reecord mode to insert mutiple "Product" into table "Products". I...

Getting error InnerJoin<> - SubSonic 3.4

Hi everyone, Here is code for the InnerJoin and I am using MSSQL 2005. public static DataTable GetItemList() { DataTable dt = new DataTable(); IDataReader reader = _db.Select .From<Item>() .Where(ItemTable.IsDeletedColumn).IsEqualTo(false) ...

Invalid Objet Name Exception Thrown on Update

I have a project using Simple Repository which was working before I rebuilt my dev machine. This may just be coincidence but I am now using SQL Server 2008 Express to develop against rather than 2005 and now when I run my project I get the exception "Invalid object name 'TableName'". the table exists as records are inserted fine but when...

SubSonic "Save" improvement suggestion

[We are using ActiveRecord.] While running Sql Server Profiler, we noticed that a simple "Save" was preceded by a good bit of database activity. We found that the SubSonic core runs through all the properties and saves their values in a dictionary before it actually does the save. We typically "extend" our data objects in partial class...

errors when i use subsonic

i downloaded subsonic and am using the instructions in this page http://subsonicproject.com/docs/Using_ActiveRecord. i get the following error when i run the custom tool on ActiveRecord.tt, Context.tt and Structs.tt files. i dont know where to look to troubleshoot. Error 2 A namespace does not directly contain members such as fields o...

Doing joins with SubSonic/ActiveRecord easily?

Hello, I am using SubSonic with the ActiveRecord template. I like it pretty well so far but can not figure out how to do a join query. I have read this link but the generated class templates it creates does not have anything of type IColumn Is there something I am missing here? Also, I am using SubSonic 3.0 ...

SubSonic ActiveRecord templates: generated code produces error converting int? to int

I just started exploring SubSonic 3's ActiveRecord, and it's initial code generation has created errors. Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?) Here's the line it throws the exception on: public override int GetHashCode() { return this.pkEmp; ...

SubSonic + Oracle - what's better 2.2 or 3?

Hello, I've been using SubSonic 2 & 2.2 for a few years now with Sql Server. For my new job I just recently used SubSonic 2.2 with Oracle and ran into a few small issues. Example: It could not find a column in a table at run time even though it found it during the mapping. Does SubSonic 3 offer better Oracle support than 2.2 ? It see...

Complete Info for Setting Up SubSonic 3 with Oracle

Hello, I'm looking for the complete steps for setting up SubSonic 3 with Oracle 10g. I see a lot of pieces out there, but no clear list. Please correct me where I'm wrong: Create Class Library (.net 3.5) create an app.config with a valid connectionString to your db Download the latest version of SubSonic 3 (today it's SubSonic_3.0.0.4...

Subsonic 3: How do I generate predefined set of stored procedures?

I have a large database with 1000s of stored procedures.. But I need to use only some of them (say about 25 stored procs out of 1000). What should I change in T4 templates to limit the code generation to only those stored procedures that I need? Otherwise Subsonic 3 will generate all of them... Thanks, Zohrab. ...