This is a discussion on example of Inserting and Retrieving data from xml file within the ASP and ASP.NET Programming forums, part of the Web Development category; This is an example of Inserting and Retrieving data from xml file. private void Page_Load(object sender, System.EventArgs e) { // ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| This is an example of Inserting and Retrieving data from xml file. private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if(!IsPostBack) { BindGrid(); } } private void BindGrid() { ds = new DataSet(); try { ds.ReadXml(@"c:\inetpub\wwwroot\WebApplication10\X MLFile1.xml"); DataGrid1.DataSource = ds; DataGrid1.DataBind(); } catch(Exception ex) { throw ex; } } private void Button1_Click(object sender, System.EventArgs e) { ds = new DataSet(); try { ds.ReadXml(@"c:\inetpub\wwwroot\WebApplication10\X MLFile1.xml"); DataRow row = ds.Tables[0].NewRow(); row["name"]=txtName.Text; row["fathersname"]=txtFName.Text; row["address"]=txtAddress.Text; ds.Tables[0].Rows.Add(row); ds.WriteXml(@"c:\inetpub\wwwroot\WebApplication10\ XMLFile1.xml"); txtAddress.Text=""; txtFName.Text=""; txtName.Text =""; BindGrid(); } catch(Exception ex) { throw ex; }
__________________ Offshore Software Last edited by Booom : 11-12-2007 at 05:11 AM. |
| Sponsored Links |
| |||
| Plz dont do link advertising in the posts.. you can have your links in your signature but we do not allow advertising in the content. I have removed all your content links. Thanks Vinoth
__________________ Vinoth Chandar Creator of Discussweb |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to insert data from a csv file into a SQL server database? | $enthil | Database Support | 7 | 05-01-2008 10:45 PM |
| DetailsView, inserting data from dropdown | Anandavinayagam | ASP and ASP.NET Programming | 5 | 12-06-2007 10:14 PM |
| reading data from a file using C# | oxygen | C# Programming | 2 | 08-23-2007 01:48 AM |
| How to retrieving IMEI &IMSI no using j2me? | mobilegeek | J2ME | 0 | 07-17-2007 11:39 PM |
| Reading WMV file meta data in .Net | oxygen | C# Programming | 0 | 07-15-2007 11:18 PM |