Binding XMl file to dataset...and updating the changes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tirumalab
    New Member
    • Apr 2007
    • 21

    Binding XMl file to dataset...and updating the changes

    public void loadgrid()
    {
    string folder = @"D:\Newfolder\ tirumala";
    if (Directory.Exis ts(folder))
    {
    DataSet ds = new DataSet();
    string xml = @"D:\Newfolder\ tirumala\myxml. xml";
    ds.ReadXml(xml) ;
    dataGridView1.D ataSource = ds;
    dataGridView1.D ataMember = ds.Tables[0].ToString();
    }
    else
    {
    MessageBox.Show ("no records were found");
    }
    }




    Hi..all, this is the code wht i have to bind a dataset table to datagrid.... whrer teh dataset is getting data from an an XMl file....

    if there occurs any changes in the XMl file .immediately those changes to be reflected on to the datagrid.... immediately when the xml file is modified ...

    kindly tell me the process to follow......... .....
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    I suggest using a datareader and rebinding the dataset to view the changes. HTH.

    Comment

    • tirumalab
      New Member
      • Apr 2007
      • 21

      #3
      ok ...but my requirement is i've a registration form when i click on the new menuitem ,a new form to be opened which consist of a tab control having 3 tabpages and my registration form spans these 3 tabpages..in the end there is a submit button ...which saves the data into an xml file.

      In my registration form one grid is placed to show the records that are avilable...
      so i want to update the changes in that are made in the XMl file immediately when i clicked the submit button....

      kindly tell me the procedure...... ..



      Originally posted by kenobewan
      I suggest using a datareader and rebinding the dataset to view the changes. HTH.

      Comment

      Working...