I have one xml file. That xml file have multiple elements. I want to read these elements and bind into datagrid using Linq in C#.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will probably be better served using DataTable/DataSet for this binding. But if you want to use LINQ 2 XML you could do something like this…
… note there are several spots where you could get NullReferenceExceptions in the above query.