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
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.
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.
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.
Re: Datagrid+Database+Sourabh Das.
sorry it was by mistake combox.. it should have been datagrid.