2014年7月13日 星期日

[RESOLVED] how changes in gridview are reflected in database ?


liek answers should be technical, i knwo the code to fill and update everything, but i actually don't know precisely that how it does ?


like i change row in GRIDVIEW and click update, it changes(updates) data in database too, some says that SQLDATA-Adapter do this but even in my update code (OnRowUpdateEvent) doesn't have any object of SQLDATA-Adapter so how come ?




????





James Dean


like i change row in GRIDVIEW and click update, it changes(updates) data in database too, some says that SQLDATA-Adapter do this but even in my update code (OnRowUpdateEvent) doesn't have any object of SQLDATA-Adapter so how come ?


You question Seems to be very technical


I dont Know Actually trying to Ask ?




if you changes something in gridview then how at the same time, a same change occurs in original database ? what carries our changed data to DATABASE ? 



Hi James,


From my understanding, is that you would like to save the changes in gridview to database.


If so, I suggest you to use the RowUpdating event of GridView to solve it, please try to refer to the following code:


 


<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>







GridView example





AutoGenerateEditButton="True"
AllowPaging="true"
OnRowEditing="TaskGridView_RowEditing"
OnRowCancelingEdit="TaskGridView_RowCancelingEdit"
OnRowUpdating="TaskGridView_RowUpdating"
OnPageIndexChanging="TaskGridView_PageIndexChanging">






If my understanding is not correct, please let me know.


Best Regards,

Terry Guo


 


沒有留言:

張貼留言