E
Egbert Nierop \(MVP for IIS\)
Hi,
I have a typed dataset, that is serialized using viewstate.
Now when a user adds a new row from a certain grid, the new row is added to
the typed dataset. The database TRANSACTION however, is done only when the
user clicks 'save record'
And indeed, the newly added rows (as well as the form data) are retrieved
and updated EXCEPT the rows from the grid.
The seem to be accepted (internally by the ViewState???)
Code (shortened and conceptualized)
void grid_onaddrow()
{
xsd.Blah.tUserGroupsRow row =
this.myDs.tUserGroups.newUserGroupsRow();
row.field = "blah";
row.field2 = DateTime.now;
this.myDs.tUserGroups.addNewUserGroupsRow(row)
/// THIS SEEMS TO ACCEPT CHANGS
ViewState["mydata"] = this.myDs; //store in ViewState
}
void button_Save()
{
// fetch screen data...
mySqlAdapter.sqlUser.Update(this.myDs.Users); // Works
mySqlAdapter.sqlUserGroups.Update(this.myDs.UserGroups); // NO EFFECT
// it has NO effect because the added/changed rows seem to be accepted at
the marked line above!
}
I have a typed dataset, that is serialized using viewstate.
Now when a user adds a new row from a certain grid, the new row is added to
the typed dataset. The database TRANSACTION however, is done only when the
user clicks 'save record'
And indeed, the newly added rows (as well as the form data) are retrieved
and updated EXCEPT the rows from the grid.
The seem to be accepted (internally by the ViewState???)
Code (shortened and conceptualized)
void grid_onaddrow()
{
xsd.Blah.tUserGroupsRow row =
this.myDs.tUserGroups.newUserGroupsRow();
row.field = "blah";
row.field2 = DateTime.now;
this.myDs.tUserGroups.addNewUserGroupsRow(row)
/// THIS SEEMS TO ACCEPT CHANGS
ViewState["mydata"] = this.myDs; //store in ViewState
}
void button_Save()
{
// fetch screen data...
mySqlAdapter.sqlUser.Update(this.myDs.Users); // Works
mySqlAdapter.sqlUserGroups.Update(this.myDs.UserGroups); // NO EFFECT
// it has NO effect because the added/changed rows seem to be accepted at
the marked line above!
}