Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8754117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:33:35+00:00 2026-06-13T13:33:35+00:00

I have been following this article to read an XML file into a datagridview

  • 0

I have been following this article to read an XML file into a datagridview control.

I am posting the relevant piece of code here.

string filePath = "Complete path where you saved the XML file";
dsAuthors.ReadXml(filePath);
dataGrid1.DataSource = dsAuthors;
dataGrid1.DataMember = "authors";
dataGrid1.CaptionText = dataGrid1.DataMember;

Now I want to be able to read any XML file without knowing the elements of the XML file, but the above method requires me to declare the dataGrid1.DataMember = "authors"; which in case of random XML file, I will not know.

Thanks,

Abijeet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:33:36+00:00Added an answer on June 13, 2026 at 1:33 pm

    With a little luck the following property has been filled:

    dataGrid1.DataMember = dsAuthors.Tables[0].Tablename;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't believe how unbelievably complicated this has been... I have the following XML...
I have been playing with the demo code from this msdn article by Jeffrey
I have been following the modified Model View Controller example presented in this article
I am trying to create a custom datasource control. I have been following this
I have been following this useful-looking article http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/ . Unfortunately he doesn't hint at
I'm new to NHibernate... I have been following this NHibernate Tutorial from Gabriel Schenker
I have been following the answer of this question: How to update existing object
I have been working on the following problem from this book . A certain
I have been following the validation for Entry boxes from here . The code
I currently running into trouble with spring security, I have been following the two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.