Dataset/dataview update

G

Guest

Hi,

This is probably a very simple question, but it's held me up for the last
hour or two:

I have a simple xml document and schema - all I am doing for the moment is
loading the xml into a dataset built from the schema (primaryDriver1 in
code), which has an associated dataview.
A textbox (TextBox1) is bound to a field within the dataview:

private void Page_Load(object sender, System.EventArgs e)
{
dataView1.AllowEdit = true;
primaryDriver1.ReadXml("C:\\temp\\OriginalPerson.Xml");
TextBox1.DataBind();
}

The member is displaying correctly after loading the page.
On pressing a button, I just want to write a new Xml file showing any change
the user may have made to the bound textbox:

private void Button1_Click(object sender, System.EventArgs e)
{
if(primaryDriver1.HasChanges())
{
DataSet ds = primaryDriver1.GetChanges();
ds.WriteXml("C:\\temp\\NewPerson.Xml");
primaryDriver1.AcceptChanges();
}
}

...but it just doesn't work. Where's the glaring hole in my knowledge?

Thanks in advance,

Aid.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top