Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to search a column and display it in gridview without using the binding property.

i have 1 combobox where list of all names are there.on selection from that list of any particular name,details of that name will display in datagridview.

here is my code.but no data showing in datagridview.
Posted
Comments
sudeshna from bangkok 11-Jul-13 5:16am    
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim cn As New SqlConnection("Data Source=.\INSTANCE;initial catalog=record;user=sa;password=gariahat")
cn.Open()
Dim da As New SqlDataAdapter("Select * from fullsort where name='" & ComboBox1.SelectedItem & "'", cn)
Dim ds As New DataSet()
da.Fill(ds)
FullsortDataGridView.DataSource = ds.Tables(0)
'FinalsortDataGridView.Refresh()
cn.Close()

End Sub
sudeshna from bangkok 11-Jul-13 5:16am    
this is the code which i have written
Priyanka7777 11-Jul-13 5:22am    
Have you missed this line in your code or not added it?

FullsortDataGridView.DataBind();
sudeshna from bangkok 11-Jul-13 5:34am    
i have not added it. where do i add? after which line?
sudeshna from bangkok 11-Jul-13 5:59am    
can you plz tell me where to add that line of code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900