|
-
Apr 23rd, 2004, 11:32 AM
#1
Thread Starter
Junior Member
Datagrid ds.table(0)
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.
-
Apr 23rd, 2004, 03:36 PM
#2
Frenzied Member
Set the DataMember property of the Datagrid to the table name.
VB Code:
grd.DataMember = "Table_Name"
-
Apr 23rd, 2004, 03:48 PM
#3
Thread Starter
Junior Member
-
Apr 23rd, 2004, 03:53 PM
#4
Frenzied Member
I think it's a lot easier to use a DataTable instead of a DataSet...
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
and you're done.
-
Apr 26th, 2004, 08:04 AM
#5
Addicted Member
What are the benefits of a datatable over a dataset?
-
Apr 26th, 2004, 08:17 AM
#6
Frenzied Member
Originally posted by Hole-In-One
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|