how to set visible table out of dataset?

G

GoodMorningSky

Hi, all.
A Form has
a DataGrid bound to a DataSet including two DataTable, A and B.
When Form is loaded the two table is populated to DataSet and DataTable A is
shown on DataGrid initially.
When a Button is clicked the DataTable B will be shown.

How can I do this?
 
E

Eric Renken

When the form first shows you are set the DataSource for the DataGrid to
table A

dataGrid.DataSource = dataSet.Tables[ 0 ];

In the onclick even of the button change the DataSource

dataGrid.DataSource = dataSet.Tables[ 1 ];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top