IT Community - Software Programming, Web Development and Technical Support

example of Inserting and Retrieving data from xml file

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) { // ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-25-2007, 05:24 AM
hanusoft hanusoft is offline
D-Web Trainee
 
Join Date: Sep 2007
Location: gurgaon
Posts: 5
hanusoft is on a distinguished road
Default example of Inserting and Retrieving data from xml file

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-12-2007, 05:13 AM
Booom Booom is offline
Administrator
 
Join Date: Feb 2007
Posts: 74
Booom is on a distinguished road
Default Re: example of Inserting and Retrieving data from xml file

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 07:29 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0