Monday, 15 March 2010

sql - How do I "select null as "Column" Using LINQ in C# -


How can I select tap in LINQ as a column option?

My SQL will be read.

  Select field 1, field 2, field 3, tap in the form of "faucet", field 4 will be field 4   

my Linux query:

  Select from table 1 new {t.field1, t.field2, t.field3, null as "null", t.field4}   

There is an error generated by Visual Studio:

Anonymous type property can not be assigned

Drop as" zero " and parameter name, null Casting in:

  Select the new one from the new {t.field1, T.field2, t.field3, someField = (string) null, t.field4}  < / Pre>  

No comments:

Post a Comment