J
jack
using the following code, I've been unable to write an updated xml document.I can see the xml
file get refreshed but even at that, it writes in the original contents. these procs come from a
databaseengine class i created, theDataStore is a dataset that gets loaded from a xml data file
when the constructor runs.
the database engine sits in a application variable within a IIS application and only one copy ever
exist in memory. updateUser is called via delegate.
all this, and writexml() technically DOES write xml, it just has a thing for defaults.
public void updateUser (zDatabaseObject theObject)
{
zUser theUser = (zUser) theObject;
DataRow theRow;
theRow = theDataStore.Tables["tblUsers"].Rows.Find(theUser.UserID);
theRow["FullName"] = theUser.FullName;
theRow["UserName"] = theUser.UserName;
theRow["Password"] = theUser.Password;
theRow["Email"] = theUser.Email;
theRow.AcceptChanges();
saveDataStore();
}
private void saveDataStore()
{
theDataStore.AcceptChanges();
theDataStore.WriteXml(theRootDirectory + "zDatabase.xml");
}
file get refreshed but even at that, it writes in the original contents. these procs come from a
databaseengine class i created, theDataStore is a dataset that gets loaded from a xml data file
when the constructor runs.
the database engine sits in a application variable within a IIS application and only one copy ever
exist in memory. updateUser is called via delegate.
all this, and writexml() technically DOES write xml, it just has a thing for defaults.
public void updateUser (zDatabaseObject theObject)
{
zUser theUser = (zUser) theObject;
DataRow theRow;
theRow = theDataStore.Tables["tblUsers"].Rows.Find(theUser.UserID);
theRow["FullName"] = theUser.FullName;
theRow["UserName"] = theUser.UserName;
theRow["Password"] = theUser.Password;
theRow["Email"] = theUser.Email;
theRow.AcceptChanges();
saveDataStore();
}
private void saveDataStore()
{
theDataStore.AcceptChanges();
theDataStore.WriteXml(theRootDirectory + "zDatabase.xml");
}