subsonic2.2

SubSonic2.2 SharedDbConnectionScope and TransactionScope Transaction Confusion

ARGH!!! There seems to be a little confusion surrounding the SharedDbConnectionScope and TransactionScope objects to enable wrapping your SubSonic queries within a transaction. The docs suggest specifying the using SharedDbConnectionScope wrapped around the using TransactionScope... using(SharedDbConnectionScope scope = new SharedDbC...

Add additional namespace to SubSonic 2.2 generated files

I think it should be possible to add additional namespaces to the generated classes without modifing SubSonic's core or the CS_ClassTemplate.aspx, but instead with a SubSonic config parameter. But atm I can't find any example. Does anyone know how this config option (if any) is called? ...

SubSonic Stored Procedure Issue - Data Generated at Stored Procedure is different from Data Received by Stored Procedure in Output Parameter

Hi All, I am facing a unknown problem while using stored procedure with SubSonic. I have written a stored procedure & application code that takes first name & last name as input parameter and return last login id as ouput parameter. It creates login id as first character of first name & complete last name for no-existing login id otherw...

Error with Subsonic 2.1

I'm getting very odd errors when compiling our Data Access library (all subsonic). Errors are Error 35 The type name 'Web' does not exist in the type 'S3.DACL.System' C:\Projects\S3\src\DACL\AspnetUser.cs 369 63 DACL And Error 37 The type name 'ComponentModel' does not exist in the type 'S3.DACL.System' C:\Projects\S3...

Update a column value based on another column value with SubSonic 2.1/2.2

I have the following code using SubSonic 2.1/2.2 SubSonic.Update(<some table>) .Set(<column A>) .EqualTo(<column B>). Where(condition...).Execute() I would like to change it to update "column A" with the value of "column B" + 1. How can I do it with this syntax. Is there a better SubSonic syntax to achieve the same thing: ColumnA = ...

SubSonic 2.2 Class Generation

Hi, I am using SubSonic on a project with many tables which were created by a sourcecode generator. I noticed Some classes created by SubSonic were generated without code and have the folowing message The class...was not generated because ... does not have a primary key. Is there any way for me to get the code to be generated without ...

InlineQuery and Oracle

Hi I'm writing a proof of concept and when using InlineQuery() or CodingHorror() I get an error stating my target table is an invalid object. However, if I use Query() using the same SQL Select statement and connection string, I get results as expected. Here's the code: string sql = @"SELECT * FROM PER_ALL_PEOPLE_F WHERE ROWNUM <= 10"...

Subsonic 2.2 InnerJoin Across Two Databases

Can anyone provide an example of how to join across two schemas using subsonic 2.2. This doesn't work: SqlQuery qu = new Select("*") .From(NorthwindLeads.Lead.Schema) .InnerJoin(Northwind.StatsMap.SourceIdColumn, NorthwindLeads.Lead.SourceIdColumn); ...

Subsonic 2.2 & Sqlite

Hi, I've tried to use Subsonic 2.2 & System.Data.Sqlite.Dll latest version (1.65.0), in my project. and recevied an error message, which gave me the idea subsonic got a problem with the sqilte provider. I've switched to it's previous version, 1.60.0 and it seems like the problem was solved. any info regarding this issue? does subsoni...

SubSonic: Case sensitive test?

Hey guys! I'm curious if there's a way to do a case sensitive string comparison in SubSonic? I have the following statement: return new Select() .From<Account>() .Where("email").IsEqualTo(email) .And("password").IsEqualTo(password) .ExecuteSingle<Account>();...

delete multiple rows from a table based on values in other tables

I use subsonic 2.2 and C# and can't figure out the correct syntax to accomplish a multi-row delete that I would code in SQL as: delete Documents from Documents d join Job_document_ref r on r.document_id = d.document_id where r.job_id = @jobid Thanks. ...

Getting a log of the SQL SubSonic is using

Linq2SQL has the great Log property to see what the actual SQL statements that it is generating. Does SubSonic 2.2 have something similar to this? ...

SubSonic OpenExpression/CloseExpression

Hey All! I'm trying to construct a query that is something like this: Where column = "value" AND column2 = "value" AND (column3 = "value" OR column4 = "value") I have this code: return new Select() .From(LessonChallenge.Schema) .Where(LessonChallenge.ChallengerStatusColumn).IsEqualTo("Finished") ...

Subsonic query: Problem with the produced query

Hello there, I'm having a problem with subsonic quey. The deal is, I have a View and I want to query it's data to produce something like the following SQL statment: select * from myView where (col1 like '%a%' or col2 like '%a%' or col3 like '%a%') and col4 = 1 and col5 = 2 But instead the query that is submited to the DB is somet...

InnerJoin with Where Expression trouble

I am using Subsonic 2.1 and I need to do an innerjoin and use a where expression and I keep getting the error: Must declare the scalar variable "@Partner" Here is my code: Dim ds As DataSet = UWP.Model.DB.Select("TOP 30 FirstName, LastName, EmailAddress, CustomerRowID, CompanyName") .From("Customer").InnerJoin("Partner") .W...

SubSonic: Selecting all columns with an aggregate

Hey all, How would you best handle constructing this SQL statement in SubSonic? SELECT ac.* , SUM(pt.amount) AS totalPoints FROM tbl_account AS ac INNER JOIN tbl_pointTracking AS pt ON ac.id = pt.accountID GROUP BY pt.accountID ORDER BY totalPoints DESC; I know how to handle aggregates, but not sure how to handle aggregat...

AFTER Insert / Update Custom Actions

In SUBSONIC Using VERSION 2.2 to Create a separate DAL project (DLL) I need to perform an action After a specific object class has done it's UPDATE or INSERT and the changes have been committed. Right now I have partial class which is overriding the AFTERCOMMIT and calling my custom action in there BUT I do not see a way of finding ...

Update a primary key value using SubSonic 2.2

Hello everyone, I'm currently developing an app using SubSonic 2.2 and I'm having problems updating one of the columns of a composite PK on a table. My code is roughly this: foreach (pageItem page in pages) { page.IdFile = newIdFile; page.PageNumber = counter; counter++; page.Save(); } This does not update my record....

Subsonic - Get All Columns From Joined Tables

How do I display columns from both tables with an "InnerJoin" from SubSonic? var myQuery = New SubSonic.Select().From(TableObject1) InnerJoin(TableObject2.ID,TableObject1.ID) ...

SubSonic equivalent of an SQL update

Hey everyone, I'm wondering if the following SQL update query is possible using the equivalent SubSonic commands: UPDATE MYTABLE SET MYFIELD = MYFIELD + 3 WHERE ANOTHERFIELD = ANOTHERVALUE I couldn't find a suitable way to make a reference to the same field with the Setting object. Any help on this will be greatly appreciated. Rega...