Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have question that. . i want load gridview with updating some rows.so which query is used?..

i use select query for load rows in gridview and also use update query to updating particular row.but whenever i run page update query fired but it can't update row.and when i refresh the page it updates rows.. .
Posted

1 solution

use gridview1.DataBind(); again to show the changes . as
C#
string strup = "Update FileRequest set FileStatus='1' where id=@id";
        SqlCommand cmdup = new SqlCommand(strup,Db.GetConnection());
        cmdup.Parameters.AddWithValue("id",Int32.Parse(lblReqID.Text));
        cmdup.ExecuteNonQuery();
        GridView1.DataBind();
 
Share this answer
 
v2
Comments
krupalmehta 5-Oct-11 4:41am    
but where to write gridview1.databind()
CodingLover 5-Oct-11 4:46am    
After the update your data.
uspatel 5-Oct-11 5:11am    
yes

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