>Can I do something like that? Is it hard to achieve?
Yes you do that using methods of DataSet class and it is very easy.
string file=MapPath("~/text.xml");
DataSet ds = new DataSet();
DataTable dt = null;
if (!System.IO.File.Exists(file))
{
// Create an instance of DataTable
dt = new DataTable("Test");
dt.Columns.Add("foo");
dt.Columns.Add("bar");
ds.Tables.Add(dt);
}
else
{
ds.ReadXml(file);
dt = ds.Tables["Test"];
}
dt.Rows.Add("value1", "value2");
ds.WriteXml(file);
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241