|
-
May 31st, 2007, 02:22 AM
#1
Thread Starter
Addicted Member
ComboBox+Database+Sourabh Das.
Hi,
There is a table in database which has 6 columns. I want to show only 4 selective columns. This is the code which I have written, what change do I need to do..
Code:
Dim selectstr As String
selectstr = "select * from tbl_item where isdeleted=0"
Dim ds As DataSet
ds = New DataSet
Dim adap As SqlDataAdapter
adap = New SqlDataAdapter(selectstr, conn)
adap.Fill(ds, "tbl_item")
DataGrid1.DataSource = ds
DataGrid1.DataMember = "tbl_item"
Regards,
Sourabh
-
May 31st, 2007, 02:37 AM
#2
Fanatic Member
Re: ComboBox+Database+Sourabh Das.
You can either select the four columns you wanna show in side your sql statement
vb Code:
SELECT col1, col2, col3, col4 FROM table
or you can select every columns like you are doing now and then search and hide the ones you don't wanna show in your grid.
-
May 31st, 2007, 03:00 AM
#3
Thread Starter
Addicted Member
Re: ComboBox+Database+Sourabh Das.
yes,
i need to select all the columns, because few column i am manupulating some where else, so out of all how do i show few in datagrid.
-
May 31st, 2007, 03:07 AM
#4
Re: ComboBox+Database+Sourabh Das.
I fail to see the ComboBox connection in this thread. Anyway, this page has lot's of DataGrid information, including how to hide columns.
-
May 31st, 2007, 03:24 AM
#5
Thread Starter
Addicted Member
Re: Datagrid+Database+Sourabh Das.
sorry it was by mistake combox.. it should have been datagrid.
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
|