I
Ilya Dyoshin
There is a problem:
I'm writting a client for use with various ODBC drivers.
There is a function:
System:ata:ataTable ^buildTable(System::String ^sqlQuery)
which builds new instance of DataTable based on the results of sqlQuery.
The table name is "noname".
Then I'm adding this DataTable to DataSet ^ds like
ds->Tables->Add(buildTable("some query"));
Then I'm linking my DataGridView object to this table:
dataGridView1->DataSource = ds;
dataGridView1->DataMember = "noname";
and this works well.
Unlikely, when I'm trying to build another view from another sqlQuery
there is a problem:
//Before adding new samenamed-tables I'm deleting all tables
while (ds->Tables->Count)
ds->Tables->RemoveAt(ds->Tables->Count - 1);
And table is really removed from DataSource (I've watched that). And
then I run again
ds->Tables->Add(buildTable("another query"));
dataGridView1->DataSource = ds;
dataGridView1->DataMember = "noname";
And I see table "noname" actually wasn't deleted... it's still in the
memory! and I can't see another results, but only the first.
Any suggestions?? :-(
I'm writting a client for use with various ODBC drivers.
There is a function:
System:ata:ataTable ^buildTable(System::String ^sqlQuery)
which builds new instance of DataTable based on the results of sqlQuery.
The table name is "noname".
Then I'm adding this DataTable to DataSet ^ds like
ds->Tables->Add(buildTable("some query"));
Then I'm linking my DataGridView object to this table:
dataGridView1->DataSource = ds;
dataGridView1->DataMember = "noname";
and this works well.
Unlikely, when I'm trying to build another view from another sqlQuery
there is a problem:
//Before adding new samenamed-tables I'm deleting all tables
while (ds->Tables->Count)
ds->Tables->RemoveAt(ds->Tables->Count - 1);
And table is really removed from DataSource (I've watched that). And
then I run again
ds->Tables->Add(buildTable("another query"));
dataGridView1->DataSource = ds;
dataGridView1->DataMember = "noname";
And I see table "noname" actually wasn't deleted... it's still in the
memory! and I can't see another results, but only the first.
Any suggestions?? :-(