Click here to Skip to main content
15,906,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two data table.
Now i want to update(means save in sql server) both table row together.
if any table row is not save successfully or give error then previous save data of both table is rollback.

is possible then give any example
Posted
Comments
Pong D. Panda 13-Apr-11 4:39am    
Were the two datatable required? if not, use SqlTransaction, it will automatically rollback if an error occurs.
Rakesh From Patna 13-Apr-11 4:45am    
In first table i store student table and second table i store bill details. so both data table is store at a time in sql server. I use connected mode and solve above problem but i want to how to work in disconnected mode.

1 solution

Look at using an SQLTransaction: that is exactly what it is there for. There is information and an example on MSDN[^]

Next time, try to Google first: you could have had this a lot quicker if you had!
 
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