I want to select all the fields of one table, and only specifics fields of a second table. Are there any way to do it like with table.* in SQL?
var things = from t in db.table1
from t2 in db.table2
where ...Join Clause...
select new { t.*,t2.onefield}
obviously this code don’t work, but I think it ilustrate my pourpose.
if I use
select new {t,t2.onefield}
it compiles, but it fails when I assign it to a datasource of a datagridview. Currently I’m writing every field that I need of every table.
Thanks.
That isn’t good practice in SQL and, even if it can be done with Linq, wouldn’t be good practice with Linq either, unless Linq would generate T-SQL code that expands to all the columns of the table.