Visual C#

ADO.NET Visual Support: The Table Adapter

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…

1 min read201 words

Introduction#

Once you have set up your data source and data set, the database values can be integrated into your application. You must now define where each control gets its information. Visual Studio provides a tool called a table adapter for this purpose, which pulls data from a table and provides it to your Windows controls.

Creating a Table Adapter#

Table adapters can be created in several ways:

  • 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: 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 After dropping the table, Microsoft Visual Studio would create both a data set and a table adapter.

Home Copyright © 2010-2011 C# Key