Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a datatable called dt & computes the sum value of the data row (particular column) and shows it in a textbox,when i delete a row from datagridview & datatable
by calling the following code

dt.rows[0].delete();
dt.acceptchnges();


I expect the data to be deleted from the database but the textbox value (displaying the sum value) does not change when i requery the database.Please some one help me





regards:
rahul
Posted
Updated 1-Nov-11 9:46am
v4
Comments
Xeshan Ahmed 1-Nov-11 9:30am    
insufficient information....what exactly you need tell us and share ur code.

dt.acceptchnges();
method does not update the database but to tell the datatable that all your data table rows are marked as rowState to unchanged.

If you want to update the database you have to do seperately
 
Share this answer
 
Use the sum() function.....

for example.

query="select sum(column name) from table"


here when u delete the rown also...sum does not effexts.
 
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