Answer to Question #12385 in C# for marjan

Question #12385
how can i use arrays with select in linqs
var[] q ;
DataClasses1DataContext db = new DataClasses1DataContext();
q = from c in db.school1s select c;
1
Expert's answer
2012-07-26T12:00:30-0400
When you use a linq query it returns you an IEnumerable<Your class>. To get an array simply use linq extension method ToArray():




q =( from c in db.school1s select c).ToArray();

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS