English 中文(简体)
LINQ 2 SQL N-Tier Application
原标题:

im trying to test and then implement LINQ 2 SQL as my Data Access to my N-Tier Application, as i read some info today, i added to my database a DateTime column as this reflected in my L2S Designer i changed the TimeStamp property of each "column" in the designer to true and this forced AutoGenerated Value to true as well. But when i attach my Object back to the datacontext i get "Members System.DateTime ModifiedDate and System.Data.Linq.Binary TimeStamp " both marked as row version. InvalidOperationException.

I have this feeling because i added this column as ALLOW NULL because i have rows and i just don t want to delete them, could take part in this. I also when i try to update the object i don t send the ModifiedDate with it and gets the default value. This could cause a concurrency issue i guess, but I m not there yet.

I just want to update it for now with no action on concurrency exception. But, another step will be to handle this things.

Any ideas?

最佳回答

One problem you might have is that a DateTime column is not a Timestamp column. If you added a DateTime column for L2S concurrency checking, you should have made the column a Timestamp column, not a DateTime column.

Randy

问题回答

暂无回答




相关问题
LINQ to SQL as databinding source for WPF Treeview

I wonder if someone could provide a simple example of the following. (preferably in VB.Net): I have an SQL database with related tables and I am successfully using LINQ to SQL in other areas of my ...

Linq to SQL insert/select foreign/primary records

I have table A and Table B. Table B contains two columns, Name and ID. Table A contains several columns and a foreign key column pointing to B.ID called B_ID On the client side, I have all the data I ...

LINQ to SQL Dynamic Sort question

How do I code the Select clause in my LINQ satament to select column aliases so I can sort on them basically I want to accomplish this SQL statement in LINQ: select type_id as id, ...

Using a schema other than dbo in LinqToSql Designer

Is there a way to specify in a data connection or the LinqToSql Designer a schema? Whenever I go to setup a data connection for LinqToSql there doesn t seem to be anyway to specify a schema and I ...

热门标签