jonathan 0

jonathan 0

  • NA
  • 13
  • 0

Creating a new record. PLEASE HELP!

Oct 13 2004 12:20 PM
Hello all, I need some advice on the steps to do the following: I have a form that displays details of Accounts. The form has navigation buttons to move through a DataView dvAccounts on DataTable dtAccounts. The form also has a "NEW" button. The NEW_Click event does the following: 1. DataRowView newRow = dvAccounts.AddNew(); 2. newRow.BeginEdit(); set initial default values for newRow fields including a dummy account number 00000. newRow.EndEdit(); 3. Move to the new row using dvAccounts.Find(00000) and display on the form. 4. Let the user enter the real values for this new account and hit "SAVE". My question is this; What state is the newRow in at this point? When I call daAccounts.Update are both the DataAdapter's INSERT command and UPDATE commands called because the row is new but also has been edited? The INSERT and UPDATE command both have return parameters. Must I save the new dummy account to the database first and then allow the user to edit it? What if another user were to copy the Accounts table to a dataset while the dummy account is sitting there? So many questions!!!!!!!!!!!!!!!! Thanks jmatt

Answers (2)