InitPhoneAdapter: Part 2
The second part of InitPhoneAdapter 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 method body to the InitPhoneAdapter stub in PhoneForm.cs.
...
//Create UpdateCommand
phoneAdapter.UpdateCommand = cnCache.CreateCommand();
phoneAdapter.UpdateCommand.CommandText = updateSQL;
//Add input parameters for UpdateCommand
AddInputParams(phoneAdapter.UpdateCommand, "Number", "PhoneNumberType", "ID");
//Create DeleteCommand
phoneAdapter.DeleteCommand = cnCache.CreateCommand();
phoneAdapter.DeleteCommand.CommandText = deleteSQL;
//Add input parameters for DeleteCommand
AddInputParams(phoneAdapter.DeleteCommand, "ID");
}