call today Call Today 320.281.0605

Linq to Sql- AutoID not working

July 31, 2009

Using Linq to Sql Auto IDs do not work by default. 

Lets say you have a table “Property” with a primary key of “PropertyId”.  In the table definition it is set as a unqueidentifier and by default it is assigned a NewID().

Now go to your Linq to Sql and create your dbml, drag your Property table into it.

In order to have the PropertyId generated using the Default Value go  to the properties of the PropertyId field and set Auto Generate Value to True and Auto-Sync to OnInsert.

I am sure many already know this, but I hope it can help save some time for others. 

Download Full Movie Online Lamictal