How can I get ride off the dataset table name from showing in datagrid.
I have to click the "table" link in order to see my datagrid.rows.
I have tried a few grid properties ( grd.ParentRowsVisible = False; grd.Expand(-1)), but no luck.
Printable View
How can I get ride off the dataset table name from showing in datagrid.
I have to click the "table" link in order to see my datagrid.rows.
I have tried a few grid properties ( grd.ParentRowsVisible = False; grd.Expand(-1)), but no luck.
Set the DataMember property of the Datagrid to the table name.
VB Code:
grd.DataMember = "Table_Name"
Thank you wey97.
I think it's a lot easier to use a DataTable instead of a DataSet...
and you're done.VB Code:
Dim con as New Connection(...) Dim ad as New DataAdapter("SELECT * FROM...", con) Dim dt as New DataTable ad.Fill(dt) grd.DataSource = dt
What are the benefits of a datatable over a dataset?
None other than not having to remember to set the DataMember of the DataGrid which there has been a lot of confusion over.Quote:
Originally posted by Hole-In-One
What are the benefits of a datatable over a dataset?