subsonic2.2

Can't update nulable column with NULL value to overwrite some value

Hi, I have a subsonic version 2.2.0.0. I have a SQL Server 2005 table "Items" with column CategoryId uniqueidentifier null. For this table Subsonic has generated a class with property Guid? CategoryId First I insert an record with some valid CategoryId value. Next I try to update (set to NULL) CategoryId of same record item.Catego...

Retrieve AutoIncrement key value when the column is NOT the first one in the table

Hello there, I've got a question regarding how to retrieve the auto-increment or identity value for a column in SQL Server 2005, when said column is not the first declared column in a table. I can get the generated value for a table just by issuing the following code: MyTable newRecord = new MyTable(); newRecord.SomeColumn = 2; newRec...

SubSonic-based app that connects to multiple databases

Hello there, I currently developed an app that connects to SQL Server 2005 database, so my DAL objects where generated using information from that DB. It will also be possible to connect to an Oracle and MySQL db, all with the same table structures (aside from the normal differences in fields, such as varbinary(max) in SQL Server and B...

How can i tell SubSonic 2 to use a different .config file?

I'm using SubSonic 2 from within a project and I'd like to specify a different .config file from the default App.config. How can I tell SubSonic to use a specific config file? ...

SubSonic: MaxLength of TableColumn (exceeding)

Hey all! So, we're using SubSonic as our DAL/ORM for one of our projects. Everything has been running smoothly (the database already existed, so we used SubSonic on top of it), however, on occasion we'll run into an exception that says something like the integer is exceeding the max length. In this example, our MySql field is an int(4) ...

subsonic 2.2 - have a table called "systems" - how to change the generated name?

HI, I'm using subsonic 2.2, and am applying this to a system with a database structure already defined. I have a table called "systems", however, the generated Classes conflict with the "System" namespace. Other than editing the generated classes (or renaming the "Systems" table) , is there any way to keep the System name without names...

SubSonic2.2 Add() not working

I have 2 tables in my DB, Customers, Contacts. CusID is a Foreign Key in Contacts table. I tried the following Dim contact as New Contact(Guid.NewGuid()) contact.FirstName = "Mary" contact.LastName = "Jane" customer.Contacts.Add(contact) customer.Save() Customers and Contacts classes were generated with SubSonic2.2. The contact is no...

Subsonic 2.2 not updating sql changes in the V class

New to SubSonic, inherited it with a project that uses SubSonic 2.2.1 I have tried to added a column to one of my tables and run the tool to update the classes, The table name is Feedback and Feedback.cs added the new property but VFeedback.cs didn't, am I missing something? ...

Inserting primary key values using SubSonic and sqlite - problem because SubSonic thinks columns are either AutoIncrement or not

I'm using SubSonic 2.2 and sqlite and have encountered a problem when dealing with tables with an INTEGER PRIMARY KEY column that isn't AUTOINCREMENT. According to the faq: If you declare a column of a table to be INTEGER PRIMARY KEY, then whenever you insert a NULL into that column of the table, the NULL is automatically converted ...

Locking problems with sqlite and SubSonic when using transactions on a single thread

I'm getting locking exceptions when trying to use transactions with SubSonic and SQLite. I'm using this from a single thread and there are no other processes accessing my db, so I really didn't expect any such problems. If I write code like this below, I get an exception on the second call to Save() within the loop - so the third call ...

Why does SubSonic 2.0 use System.Data.SQLite version 1.0.60.0?

Anyone know why Subsonic 2.2 uses System.Data.SQLite version 1.0.60.0 instead of the latest version 1.0.65.0? ie is it just because that's when it was released or is there anything in the newer version that doesn't work with SubSonic? What does everyone else use - do you just recompile from the latest branch of SubSonic using the lates...

subsonic Invalid cast from System.Int32 to System.Byte[]

Subsonic 2.2 is throwing the error subsonic Invalid cast from System.Int32 to System.Byte[] When I do the following If template.Content Is Nothing Then MsgBox("Blank Document") Else MsgBox("Document Present") End If "template" is a SubSonic object of which it's "content" field is of t...

SubSonic 2.2 support for Lazy Laoding

Does SubSonic 2.2 support lazy loading? Can I lazy load a property of an object? If yes, where can I find info on this? ...

Exception with Subsonic 2.2, SQLite and Migrations

Hi, I'm playing with Migrations and created a simple migration like public class Migration001 : Migration { public override void Up() { TableSchema.Table testTable = CreateTableWithKey("TestTable"); } public override void Down() { } } after executing sonic.exe migra...

Make SubSonic use existing <connectionstring> instead of new data provider

I am adding SubSonic to a legacy application. This application already defines a ConnectionString. Is there a way I can use this connectionstring instead of creating a new Data Provider entry? I know that one solution is programmatically setting this in the code (i.e. SubSonic.DataService.GetInstance("Name").SetDefaultConnectionString(...

Change connection on the fly

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

Subsonic Strips trailing s from Table Name in Object names

I have a table called Group_Focus and when we generated our code with Subsonic 2.2 it's calling the object GroupFocu while the files are named GroupFocu.cs and GroupFocuController.cs. Is there anyway to get it to not strip off the s when it builds the objects? I'm using the following settings in my Provider settings in the web.config: ...

SubSonic How to Execute a SQL Statement?

Hello, My site is using Subsonic 2.2 on my site. I have 1 weird situation where I need to run some ad-hoc SQL statements. public IList<string> GetDistincList(string TableName, string FieldName) { string sqlToRun = string.Format("SELECT DISTINCT {0} FROM {1} ORDER BY {0}", FieldName, TableName); Query query = new Query(TableNam...

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

Subsonic query problem

I have a subsonic query that's like this: SubSonic.SqlQuery Qxy = new Select() .From(MessageStorage.Schema) .InnerJoin(MessageTracker.Schema) .Where("InsertDate").IsGreaterThanOrEqualTo(args[0]) .And("InsertDate").IsLessThan(args[1]) .And("MessageType").IsEqualTo(args[2]) ...