Data Access  «Prev 

Creating a command object in Microsoft SQL-Server

  1. To add a command object, right-click the Data Environment in the Project Explorer window.
  2. Now select “Add Data Command” from the menu.
  3. The Command Properties Dialog is now displayed. First, assign a name to the command object. Name it BookRecordsComd. The command object will use the connection vbookconn. It is already selected in the connection box since it is the only connection currently in the project. You also have to specify the Database Object that you want to use. You do this by pulling down the Database Object list box. Click the down arrow to the right of Stored Procedure in the Database Object text box.
  4. This command object will contain the records in the book table, so select BookTable in the Object Name list box.
  5. Those are all the properties that need to be set. Click OK to continue.
  6. Now, the command object BookRecordsCmd is shown in the Project Explorer under vbookconn. This is the end of the simulation.