SQL事务与断开连接模式一起使用 [英] Sql Transaction use with disconnected mode

查看:82
本文介绍了SQL事务与断开连接模式一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个数据表.
现在我想一起更新(意味着保存在sql server中)两个表行.
如果任何表行未成功保存或给出错误,则两个表的先前保存数据都会回滚.

然后可以给出任何示例

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

推荐答案

使用SQLTransaction:这正是它的用途.在 MSDN [
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!


这篇关于SQL事务与断开连接模式一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆