Question Create A datatable in Visual Studio 2010

zza123

New member
Joined
Sep 20, 2011
Messages
1
Programming Experience
Beginner
Hi,
im newbies in vb.net
i would like to know how do i create a simple data table in VS 2010.
The data would be from SQL database.

thank you...
 
It depends exactly what you mean by "data table". There is a DataTable class in .NET that is supposed to basically represent an in-memory database table. It's just for storing data though, not displaying it. If you want to display the data in a DataTable to the user then you would generally do so by binding it to a BindingSource and binding that to a DataGridView. You can add those two components in the designer and binding, in this case, just means assigning to the DataSource property. Check this out for some code examples of working with DataTables and other ADO.NET objects:

Retrieving and Saving Data in Databases

Follow the Data Walkthroughs link in my signature for some examples from MSDN that use more of the data tools built into VS.
 
Back
Top