Initialization
The PhoneForm_Load method is the event handler for the PhoneForm Load event. The method does the following:
-
Invokes the InitConnection method. This method, which you have already coded, initializes the connection to Caché.
-
Invokes the InitConAdapter method. This method creates the CacheDataAdapter object that connects the data set to the Provider.Contact table in Caché. It is explained on a later page in the tutorial.
-
Invokes the InitPhoneAdapter method. This method creates the CacheDataAdapter object that connects the data set to the Provider.PhoneNumber table in Caché. It is explained on a later page in the tutorial.
-
Invokes the InitDataSet method. This method creates the data set that represents the Caché data (both the Contact and PhoneNumber tables) in the .NET client. It is explained on a later page in the tutorial.
-
Initializes the comboboxes for the Edit Phone Information and Edit Contact Information sections of the form.
-
Invokes the DisplayTreeView method. This method creates the tree displayed on the left hand side of the form. It is explained on a later page in the tutorial.
Here is the method. Add the body of the method to the PhoneForm_Load stub in PhoneForm.cs.
private void PhoneForm_Load(object sender, System.EventArgs e)
{
InitConnection();
InitConAdapter();
InitPhoneAdapter();
InitDataSet();
comboBox1.Items.AddRange(new Object[] { "Business","Personal" });
comboBox2.Items.AddRange(new Object[]
{ "Business", "Home", "Mobile", "Fax" });
DisplayTreeView();
}