Updating data in gridview
In data driven web sites, users are normally allowed to view data and administrators are allowed to add, edit or delete data.In this tutorial I will show you how you can create an editable Grid View control for administrators to modify database records directly into the Grid View control.
click on the edit and it allow me to edit in the gridview and click on update button to update it. You can use same type of code in rowupdating event of gridview to call update method in webservice, the links for how to implement rowupdating event and inplace edit is already provided to you, take look on those protected void Page_Load(object sender, Event Args e) //however when i click on the edit, it say that " 'GV_Update' fired event Row Editing which wasn't handled " //so i cant even do the rowupdating protected void GV_Update_Row Editing(object sender, Grid View Edit Event Args e) protected void Bind Roll Info() i have solve the error but meet another error, this is my code, i tk my updating shld be wrong that why result error but i don't know how to solve it... WSRoll.update Roll(string, string, string) To remove this error in my code just make below changes[Argument Out Of Range Exception: Specified argument was out of the range of valid values. For your query you can use ither a class file or can implement it in webservice class to Just an example for your update Roll function in web service Under your rowupdaging event of gridview create the proxy of web service you consumed then using dot(.) operator on proxy you can access the update Roll function check below link for how to consum web service in application This is not with object datasource, its purely using proxy Just an example for your update Roll function in web service Under your rowupdaging event of gridview create the proxy of web service you consumed then using dot(.) operator on proxy you can access the update Roll function check below link for how to consum web service in application This is not with object datasource, its purely using proxy i am able to get All Detail the web method in the web service in the grid view, but what you say for the update Roll Info method right, how am i going to implement together with update this is hw i retrieve all data but cant edit The logic you have implemented is correct for databinding and thats the proxy of web service that i was talking about. Find Control("Label1"); Text Box Roll Data = (Text Box)GV_Update. WSRoll.update Roll(int, string, int) and you are passing WSRoll Info. Thanks in advance, In the above example is a class which is used for doing transactions related to User such as adding user, updating user etc. WSRoll.update Roll(string, string, string) To remove this error in my code just make below changes The error it self informing you what has been done wrong the signature of your update Roll function is WSRoll Info. Control Collection.get_Item(Int32 index) 74 System. A Grid View Update Event Args object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the update operation should be canceled.To cancel the update operation, set the collections, if necessary, before the values are passed to the data source.My dear friend the signature of Row Updating Event is protected void functionname(object sender, Grid View Update Event Args e) now check what you have written you have added 3 more parameters to it thats why you are getting compilation error.
Find Control("Text Box1"); Text Box Status = (Text Box)GV_Update. WSRoll.update Roll(int, string, int) and you are passing WSRoll Info.
First, we need to prepare the database table and stored procedure for gridview operations such as insert, update & delete a records, here I’m using sql server 2008 for all database activities, for this sample I have created the customer table and stored procedure for all mentioned gridview operations.
Create the customer table in your own test database using below table script and insert some records initially to load gridview with data.
Actually gridview control is built with lot of features and this control is commonly used for all applications.
And here I’m explaining some basic functions of this gridview control such as insert edit and delete a record.
A common way to use these collections is to HTML-encode the values supplied by the user before they are stored in the data source.