Skip to main content
IBM Skip to main content
spHome | Products & services | Support & downloads | My account
Software > DB2 > DB2 Developer Domain
Developing an app using Web Services, DB2, and .Net
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackNext
Creating a customer application
  


Create a Windows applicationPage 1 of 4


Using the IBM DB2 Add-ins, create a Windows application to invoke the getRateWS Web service created in the previous section.

To create a data-bound Windows application:

  1. Create a Windows C# application and name it customerApp.
  2. Open Form1.cs in design mode.
  3. Drag and drop a Windows data grid control on the form. Use this to data-bind the customer table.
  4. Drag and drop the customer table from IBM Explorer. This creates db2DataAdapter1.
  5. Click on db2DataAdapter1 and generate DataSet. Name the dataset DB2DataSet_customer.

    Generate data set

  6. Set the DataSource property of the dataGrid1 to DB2DataSet_customer.CUSTOMER. This binds the data grid to the dataset at design time.

    Bind data set to data grid

  7. Add the following code (bold) in the beginning of Form1.cs:
    
    using IBM.Data.DB2;
    
  8. Write the following code (bold) in the form load event handlers for the form:
    
    private void form1_load(object sender, System.EventArgs e)
    {
       this.db2DataAdapter1.Fill(this.DB2DataSet_customer);
    }
    

Main menuSection menuFeedbackNext
About IBM | Privacy | Legal | Contact