subsonic

SubSonic isn't generating MySql foreign key tables

I two tables within a MySql 5.1.34 database. When using SubSonic to generate the DAL, the foreign-key relationship doesn't get scripted, ie; I have no Parent.ChildCollection object. Looking inside the generated DAL Parent class shows the following; //no foreign key tables defined (0) I have tried SubSonic 2.1 and 2.2, and various MySq...

Getting subsets from Subsonic Collections

Hey, I'm using Subsonic Collections to pull a list of timesheet entries from our database and then databinding them to ASP.net user controls I've created on a page. Is it possible to break one large collection into multiple subsets based on a certain parameter? For example, each of our timesheet entries contain a job code for the part...

SubSonic MySQL Version

SubSonic 2.2 requires MySQL Connector 5.3.2.0. This is not included in the download package, nor is it any longer available from the MySQL download site. I know I can build SubSonic again from source to get around this, but this is a pain. Can someone on the SubSonic project please change the "Specific Version" flag on the MySQL assemb...

Is this possible with Subsonic

I need to generate Entities/Object from selected tables - not all. Is this possible with Subsonic and if so how? ...

DataRelation Equivalent in Subsonic 3

I have some code that returns data from a self referencing table (ID,ParentID) into a DataSet. It then adds a DataRelation to the DataSet and writes the DataSet to XML. This write the XML as the expected heirarchy. How do I do this in Subsonic? ...

Subsonic 3 and The Adjacency Model

If a table has the adjacency model applied (ID,ParentID) how can the heirarchy be returned in Subsonic 3? ...

fixPluralClassNames option not working when generating through visual studio

I have a table in my database called "Campus" and when sonic.exe generates the class it names it "Campu". So I tried setting "fixPluralClassNames" to false in my generate statement (through visual studio as an external command, it automatically picks up the connection strings in app.config) but it still generates it as "Campu". I tried r...

SubSonic InlineQuery returning wrong results with ExecuteAsCollection

Using SubSonic 2.2, I have this query: string q = @"SELECT Media.Id, Media.Title FROM Media WHERE Media.UserId = 7" DAL.MediumCollection matches = new InlineQuery().ExecuteAsCollection<DAL.MediumCollection>(q).Load(); Looping through "matches" results in every single entry in the "Media" table. However, when I do this: IDataReader r...

Subsonic: dynamic connections

Hi guys, I have an ancient mess I'm trying to shovel into tiers using subsonic. Trouble is, I have this scenario: When Hal logs in, his login uses database X for lookup data, database Y for his accounts and database Z for his contacts. When Barry logs in, his login uses database X for lookupdata, database Q for his accounts and databa...

It is possible to get MySql working with ASP.Net MVC using the Subsonic template?

I've downloaded and installed the latest ASP.Net MVC framework, and installed the Subsonic project template. The template understandably comes installed with support for MS-SQL server only, and I'm wondering if anyone has created version of the .tt template files to cater for a MySql connection? I've added the MySql connection string to...

Subsonic migrations: add subsonic state columns supplementary

Within a SubSonic migration this code: public override void Up() { TableSchema.Table test = CreateTableWithKey("test"); AddSubSonicStateColumns(test); base.Up(); } generates the following ddl for MySQL: CREATE TABLE `test` ( `id` INTEGER NOT NULL AUTO_INCREMENT, `CreatedOn` datetime , `Modif...

Subsonic 3/ASP.net mvc trying to save a null value in a datetime column

I have a table that holds system users with their last login date and time in it. The admin users of the system need to be able to add users, but when I add the new user record a validation error occurs unless I put a valid datetime in the last login date field. I've tried manually changing the field to dbnull, null, etc prior to the s...

NULL ForeignKeyTo property in Subsonic 3/ASP.NET MVC?

Issue: the primary key of the base table is named differently than the the key in the fk table. Subsonic 3 does not know how to handle that, which is fine, its beta. So I was going to change the Html.ControlFor logic to just grab the table and use the pkname from that: var fk = db.FindTable(col.ForeignKeyTo.FriendlyName); However th...

'nullable types break ToXML() in subsonic 2.2

when i call .ToXML() fail "There was an error reflecting type..." i have a nullable types how i can solve it? ...

Subsonic: Tiers of a clown

Hi guys, I've got a nice DAL generated using Subsonic. Is there a way I can generate a skeleton for the BLL? I don't want to plug the SS layer directly into my GUI. I've trudged through both SS forums and it seems that everyone calls the SSS-generated layer a DAL, but they use it as a BLL. Have you used SS and seperated the DAL and B...

Bug in SubSonic.Comparison.In

With the following code: IEnumerable<int> LocalityIds = new List<int>(); PersonCollection pc = new PersonCollection(). Where(Person.Columns.AddressLocalityId, SubSonic.Comparison.In, LocalityIds). Load(); Although the initial collection is empty Subsonic still returns all records?...

Extension method to convert SubSonic SqlQuery object to plain SQL

I sometimes need to see what SQL statement SubSonic generates. That works great with: SqlQuery qry = DB.Select().From<Product>() .Where(Products.Columns.Name).IsEqualTo("Productname"); Console.WriteLine(qry.BuildSqlStatement()); However that returns the query with parameters (SELECT ... WHERE productname = ?productn...

Need a method that accepts all kind of Subsonic Collections as a parameter

If I have a method that does something with multiple Subsonic ActiveRecords and doesn know what type exactly it is easy thanks to interfaces. public void DoSomething(IActiveRecord item) { // Do something } But what if you have a method and you don't know what Collection (e.g. ProductCollection) you get? How do I have to declare my ...

Joins with SubSonic's REST handler

I've just been playing around with the REST handler and frankly I love it. 0 lines of code and my data is accessible via HTTP? Got to love that. Anyway, the only thing I'm not sure of is whether or not I can access data from more than one table with a REST query via the REST handler. I have header records and data records with a one to m...

Can't Convert unicode Data into XML column in sql server 2008

Dear All, I already have a table with 3 column (Id bigint, Title nvarchar(450), Description nvarchar(MAX)) in sql 2008 I decide convert Title and Description column into one XML column. but when trying to update get many error like "illegal name character" or "illegal qualified name character" and etc. to solve this problem i just cre...