I am using the code below to fill a DataGridView with data, which is working fine, except the line where I want to get the tablename. The .TableName function always returns nothing.
VB Code:
Dim myAdapter As Odbc.OdbcDataAdapter = New Odbc.OdbcDataAdapter(QueryString, MyConnection) Dim myDataTable As DataTable = New DataTable Dim count As Integer = myAdapter.Fill(myDataTable) DataGridView1.DataSource = myDataTable MessageBox.Show(myDataTable.TableName) '<----- always returns nothing
Can someone kindly point out what I am doing wrong? If this wont work, then how else can I get the table name? Thanks...




Reply With Quote