Click here to Skip to main content
15,915,094 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi There,

I have encountered a small issue. I have a search textbox to search for data from the database, the search criteria work correctly and I am using an SQL datasource to perform my search. I also have an edit button on my gridview to update data, however after it brings back the correct row of data and i click the update button it reloads the entire gridview again with all the data.

behind the search button:
SQL
SqlDataSource1.SelectCommand = "admsp_GetDnisDetails @DDI = '" & txtDDI.Text & "'"
               SqlDataSource1.DataBind()



If anyone could help me I would appreciate it.

thanks.
Posted
Comments
[no name] 9-Jul-13 9:28am    
If the search code is working correctly why are you posting it? If your problem is with the update button code, why did you not post that?
ZurdoDev 9-Jul-13 9:55am    
You are likely rebinding the grid in your page_load without checking for IsPostBack.

1 solution

Sorry i wrongly posted the previous Answer.

You binding the SqlDataSource with select command, but this will not update the GridView with search values. For that you need to Bind the GridView with new Updated SqlDataSource which contains the search result.
 
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