Search Button..Plz Help
hi can anyone help me . when the user enter the name in a textbox and click the search button, the output should be display in the datagrid... Help plz have to submit my project in 8 days
geetajlo
Junior Poster in Training
72 posts since Sep 2007
Reputation Points: 8
Solved Threads: 0
This is pretty easy to do. You can tie the DataGrid to the filter function and pass textbox as a paramter to filter records on the Grid
binoj_daniel
Practically a Master Poster
645 posts since Dec 2006
Reputation Points: 25
Solved Threads: 18
just paste this code:::
Protected Sub btnchk_name_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnchk_name.Click
Dim str As String = "select ID from table1 where ID = '" & txtid.Text & "'"
Dim con As String = ConfigurationManager.AppSettings("preeconn")
Dim com As New SqlCommand(str, New SqlConnection(con))
com.Connection.Open()
Dim da As New SqlDataAdapter(str, con)
Dim dr As SqlDataReader
dr = com.ExecuteReader 'where sqldatareader ain't run without using
If Not dr.Read() Then
datagrid.datasource=com.executereader()
datagrid.databind()
End If
End Sub
-----------
preetham.saroja
Junior Poster in Training
82 posts since Jun 2007
Reputation Points: 5
Solved Threads: 1
Netcode
Veteran Poster
1,021 posts since Jun 2009
Reputation Points: 43
Solved Threads: 67