tags:

views:

200

answers:

2

I have a CreatedBy column in a table which datatype is a int. SubSonic crashes on this because apperently it uses CreatedBy, CreatedOn, ModifiedBy and ModifiedOn. The By columns need to be strings.

Is there a way to let SubSonic know that it has to ignore these columns?

+1  A: 

No, you probably are going to have to rename the column to CreateByUser or something.

You can also change it to a nvarchar(50) and create a column ModifiedBy nvarchar(50) and have it work just fine too.

Rick Ratayczak
A: 

Yes... this is totally doable. First of all show us the code that makes it crash. I probably know what it is. You are probably trying to do something like this

MyRecord.Save();

Where as you need to do pass in the id of the person that is creating the record aka.

MyRecord.Save(55);

SubSonic knows what datatype your columns are so you don't need to tell it what datatype it is. Also if you look there are overloads of the Save method namely Save(int id), Save(string id), and Save(Guid id). So as long as you use an int,string or guid for your CreateBy column you are good to go, you just need to remember to pass in the ID as SubSonic expects it if you use those columns.

runxc1 Bret Ferrier