To create a data adapter and connection

1 â–  Choose File ^ New ^ Application where Application is the language type you are using.

  1. Click on the Data Explorer tab and drill down to find the IBConn1 connection under the Interbase node.
  2. Drag and drop the EMPLOYEE table onto the Windows Form.

This creates a BdpDataAdapter and BdpConnection and displays their icons in the Component Tray.

4. Select the data adapter icon, then click the Configure Data Adapter... designer verb in the Designer Verb area at the bottom of the Object Inspector.

This displays the Data Adapter Configuration dialog.

5. Rewrite the SQL statement that is displayed in the Select tab of the dialog to:

SELECT EMP_NO, FIRST_NAME, LAST_NAME, SALARY FROM EMPLOYEE WHERE FIRST_NAME = ?;

As you can see, this statement is limiting the number of fields. It also contains a ? character as part of the Where clause. The ? character is a wildcard that represents the parameter value that your application passes in at runtime. There are at least two reasons for using a parameter in this way. The first reason is to make the application capable of retrieving numerous instances of the data in the selected columns, while using a different value to satisfy the condition. The second reason is that you may not know the actual values at design time. You can imagine how limited the application might be if we retrieved only data where first_name = 'Bob'.

  1. Click the DataSet tab.
  2. Click New DataSet.
  3. Click OK.

This creates the DataSet that represents your query.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment