I've created dataset using 'Add new Data source' - ShoppingMallDataSet
Then I what to get data from table TClient. So I've created global variable BindingSource bs and initialize it in method GetData
and here its using in code
DataSource is not null but rgv has neither rows no columns. Where is the problem?
Then I what to get data from table TClient. So I've created global variable BindingSource bs and initialize it in method GetData
void
GetData(){
using
(ShoppingMallDataSet smds =
new
ShoppingMallDataSet())
{
using
(var conn =
new
SqlConnection(connection_string))
{
using
(var adapter =
new
ShoppingMallDataSetTableAdapters.TClientTableAdapter() { Connection = conn })
{
adapter.Fill(smds.TClient);
bs.DataSource = smds.TClient;
}
}
}
and here its using in code
.....
rgv.MasterTemplate.DataSource = bs;
GetData();
DataSource is not null but rgv has neither rows no columns. Where is the problem?