Is there a way to not fetch a specific column using linqtosql without having to use an anonymous type and specify each returned filed individually?
We use SQLMetal to generate the dbml file which contains all the types into which to put the queried data results. However, when select columns are included in the linq query, the results go into an anonymous type instead of the type declared in the dbml file. I would like to select all but one of the columns from a particular table, but still have the results returned in the related dbml type.
Any ideas appreciated.
Thanks all for your input. The final solution I have settled on is to simply specify the columns i want to bring back BUT to do this within the Linq statement in a new object of the type I want... an example should help!:
Table log has three colums
But I only want DateLogged & Serialized data. However, I would like this within a datacontainer generated by SQLMetal
I achieved this with the following statement:
Dim q = From logItem In dc.Log Select New Log With {.LogID = logItem.LogID, .DateLogged = logItem.DateLogged}
Hope that helps someone else out there!