Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello all,

Please help me in the following:
I have created a datagrid to display data from a table in SQL using ASP.NET and stored procedures.
The data is getting displayed properly.

I want to add search functionality.

On clicking the search button, the required data should get displayed in a single row of the datagrid.
I want to use textboxes to insert search data.
Posted
Updated 24-Jan-11 21:46pm
v3
Comments
Dalek Dave 25-Jan-11 3:46am    
Edited for Readability.

Also This[^] might help you.
 
Share this answer
 
v2
Comments
debo_india 27-Jan-11 1:11am    
i did the suggested changes to my code but to no effect :(
 
Share this answer
 
Comments
debo_india 27-Jan-11 1:10am    
i did these changes to my code but it didnt help at all :(
Can u help me any further?? thanx to all for your replies..my code is as follows:
Sub fill_grid()
con.Open()
com = New SqlCommand("proc_search", con)
com.CommandType = Data.CommandType.StoredProcedure
com.Parameters.Add(New SqlParameter("@Mode", Data.SqlDbType.VarChar, 20))
com.Parameters.AddWithValue("@strFeedTitle", cmbtitle.Text)
com.Parameters.AddWithValue("@strFeedNm", txtname.Text)
com.Parameters.AddWithValue("@strFeedEmail", txtemail.Text)
com.Parameters("@Mode").Value = "select1"
da = New SqlDataAdapter
da.SelectCommand = com
da.SelectCommand.Connection = con
ds = New DataSet
'ds.Tables.Add("tbl1")
da.Fill(ds, "tbl1")
con.Close()
Try
If ds.Tables("tbl1").Rows.Count > 0 Then
gd_feedback.DataSource = ds.Tables("tbl1").DefaultView
gd_feedback.DataBind()
gd_feedback.Visible = True
gd_feedback.EnableViewState = True
End If
Catch ex As Exception
Response.Write(ex.ToString)
End Try
End Sub
 
Share this answer
 

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