76 373
Assignments Done
Successfully Done
In May 2019

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;
Expert's answer
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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions