1.

Can we use linq to query against a DataTable?(a) Yes(b) No(c) Either Yes or No(d) None of the mentionedI got this question during an interview.My query is from Fundamental of LINQ in portion Delegates, Generics and LINQ of C#

Answer»

Correct option is (b) No

The best I can explain: We cannot USE query against the DataTable’s Rows COLLECTION, since DataRowCollection doesn’t implement IENUMERABLE. We need to use the AsEnumerable() EXTENSION for DataTable. As an example:



Discussion

No Comment Found

Related InterviewSolutions