InitConAdapter: Part 2
The second part of the InitConAdapter does the following:
-
Creates the Update command for the adapter.
-
Adds the input parameters to the Update command using the AddInputParams helper method.
-
Creates the Delete command for the adapter.
-
Adds the input parameters to the Delete command using the AddInputParams helper method.
Add the body of the method to the InitConAdapter stub in PhoneForm.cs.
...
//create UpdateCommand
conAdapter.UpdateCommand = cnCache.CreateCommand();
conAdapter.UpdateCommand.CommandText = updateSQL;
//Add input parameters for UpdateCommand
AddInputParams(conAdapter.UpdateCommand, "Name", "ContactType", "ID");
//Create DeleteCommand
conAdapter.DeleteCommand = cnCache.CreateCommand();
conAdapter.DeleteCommand.CommandText = deleteSQL;
//Add input parameters to DeleteCommand
AddInputParams(conAdapter.DeleteCommand, "ID");
}