Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > Example of Inserting and Retrieving data from xml file.

Reply
Thread Tools

Example of Inserting and Retrieving data from xml file.

 
 
hanusoft hanusoft is offline
Junior Member
Join Date: Sep 2007
Posts: 8
 
      09-29-2007
This is an example of Inserting and Retrieving data from xml file.

http://www.hanusoftware.com


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;
}



Software Development Company
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting data in to xml file with ASP.NET/VB2005 Aaron ASP .Net 0 01-01-2006 05:41 PM
Data/File Structure and Algorithm for Retrieving Sorted Data Chunk Efficiently Jane Austine Python 14 10-09-2004 05:54 PM
- Re: Data/File Structure and Algorithm for Retrieving Sorted Data Chunk Efficiently Jane Austine Python 2 10-05-2004 01:54 PM
retrieving xml strings from database, remove pi and build xml Kathy Burke ASP .Net 0 08-04-2003 01:33 PM
Inserting into one table data from 2 tables and some input data. Renie83 ASP General 1 07-10-2003 08:29 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57