A "DataSet" is a group of records contained in a Visual Studio variable. When you add tables to the DataSet, you can save multiple tables within one variable. The DataSet object makes it more convenient to hold several tables in your database. Add a table to the DataSet using the "Add" function; the table you add is called a "DataTable."
Instructions
- 1
Click the Windows "Start" button and select "All Programs." Click ".NET Framework" to open a list of shortcuts. Click the shortcut labeled "Visual Studio" to load your software.
2Click "File," then "Open." Double-click the Visual Studio project to which you want to add the DataSet and tables.
3Double-click the form in "Solution Explorer" that will house the DataSet.
4Create the DataSet variable. If you already have the DataSet created, you do not need to create another one. If you do not have one created, type the following code:
"DataSet customers = new DataSet("customers");"
The code above creates a DataSet that holds a table of customers.
5Add the table to the DataSet. In this example, a table named "NewCustomers" is added to the DataSet. Type the following code to add a table:
"DataTable newcustomers = customers.Tables.Add("newcustomers");"
0 comments:
Post a Comment