Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

InitConAdapter : パート 2

InitConAdapter のパート 2 では以下の作業を行います。

  1. アダプタの Update コマンドを作成します。

  2. AddInputParams ヘルパー・メソッドを使用して、入力パラメータを Update コマンドに追加します。

  3. アダプタの Delete コマンドを作成します。

  4. AddInputParams ヘルパー・メソッドを使用して、入力パラメータを Delete コマンドに追加します。

このメソッドの本文を、PhoneForm.csInitConAdapter スタブに追加します。


 ...
   //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"); 
}
 
FeedbackOpens in a new tab