CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Example of Inserting and Retrieving data from xml file

Print topic Send  topic

Author Message
hanusoft

Posts: 5
Posted: 09/29/2007, 12:50 AM

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\XMLFile1.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\XMLFile1.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;
}





_________________
[url=http://www.hanusoftware.com]
Offshore Software [/url]
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.