Home

ADO.NET Visual Support: The Table Adapter

     

Introduction

After creating a data set and a data source, the database that holds the values is ready to make them available to your application. The next step is to indicate to each control where its data would come from. To assist you with this task, Microsoft Visual Studio includes a tool that allows you to create an object that can retrieve the values (data) from a table and make them available to the Windows controls. This object is called a table adapter.

   

Creating a Table Adapter

There are various ways you can create a table adapter:

  • If you had added a data source to your application and created a binding source, to create a table adapter, under the form, you can click the binding source object. In the Properties window, click the DisplayMember field and, from its combo, select the name of the table:
     
    Data Binding

    After doing this, Microsoft Visual Studio would create a table adapter. You can then accept or change its name
  • Probably the best way to create a table adapter consists of generating it from the Data Source window. To do this, after creating a data source, from the Data Source window, you can drag the table node and drop it on the form
     
    The Table Adapter
     
    After dropping the table, Microsoft Visual Studio would create both a data set and a table adapter.
 

Home Copyright © 2010-2016, FunctionX