I have 62 columns in a table under SQL 2005 and LINQ to SQL doesn't handle the updates though the reading would work just fine, I tried re-adding the table to the model, created a new data model but nothing worked, I'm guessing I've hit the maximum number of columns limit on an object, can anyone explain that ?
Sql – Maximum number of columns in a LINQ to SQL object
linqlinq-to-sqlsql-server-2005
Related Topic
- Sql – Add a column with a default value to an existing table in SQL Server
- Sql-server – Check if table exists in SQL Server
- Linq – Multiple “order by” in LINQ
- C# – Group By Multiple Columns
- C# – How to use LINQ to select object with minimum or maximum property value
- Sql – How to do an UPDATE statement with JOIN in SQL Server
- C# – Group by in LINQ
Best Answer
I suspect there is some issue with an identity or timestamp column (something autogenerated on the SQL server). Make sure that any column that is autogenerated is marked that way in the model. You might also want to look at how it is handling concurrency. If you have triggers that update any values on the row after it is updated (changing values) and it is checking all columns on updates, this would cause the update to fail. Typically I create my tables with a timestamp column -- LINQ2SQL picks this up when I generate the model and uses it alone for concurrency.