Using viewstate Accepts data changes :<

  • Thread starter Egbert Nierop \(MVP for IIS\)
  • Start date
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!
}
 

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,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top