Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (login required).

InitConAdapter: Part 2

The second part of the InitConAdapter does the following:

  1. Creates the Update command for the adapter.

  2. Adds the input parameters to the Update command using the AddInputParams helper method.

  3. Creates the Delete command for the adapter.

  4. 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"); 
Copy code to clipboard
FeedbackOpens in a new window