Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see Why Migrate to InterSystems IRIS?

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"); 
}
 
Feedback