I installed LINQ to SQL Debug Visualizer to find out exactly which query is generated behind the scenes, and that was
{SELECT [t0].[version], [t0].[ID], [t0].[Volume], ... similarly rest of the columns FROM [MyTable] AS [t0]
This was strange because I did not have a version column in my table (ever). I looked into my model and found this column
[Column(IsVersion = true)] private Binary version;
I deleted the column by commenting out these two lines and restarting the application. The newly created SQL did not have a version column, and my query worked fine.
I am using SQLCEMangoCodeGenerator to generate LINQ to SQL classes. I think the error in this tool, due to which it created an additional column, which I did not have in my table
Haris hasan
source share