如何在begin transaction中使用insert和delete查询并在c#中提交 [英] how to use insert and delete query within begin transaction and commit in c #

查看:101
本文介绍了如何在begin transaction中使用insert和delete查询并在c#中提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在begin transaction和commit transaction之间使用两个func,如下所示

I want to use two func within between begin transaction and commit transaction as shown below

try
{
Begin transaction()
Delete();
Insert();
Commit()
}
Catch() ..



问题是当断点到达删除功能并尝试执行一些删除查询时SQL企业2008然后挂起或锁定。我无法找出原因。任何人都可以帮忙。


Problem is when breakpoint reaches delete function and try execute some delete query on SQL enterprise 2008 then it hangs there or get locked. I am unable figure out the reason.can anyone help.

推荐答案

先生基本上问题出现在BeginTransaction()之后。当断点进入删除功能时。

在这个删除函数中,我们从表中删除了几行。

这个删除函数返回int。价值。



预售



Int val = delete();

如果(val == -1)



我的问题是在调用delete之后,如果条件没有断点,
Sir basically problem comes after BeginTransaction(). When the breakpoint goes into Delete function.
In this delete function ,we are deleting few rows from table .
This delete function returns int. Value.

For ex

Int val = delete();
If ( val == -1)

My problem is when delete is called , after the breakpoint does not come on if condition.


这篇关于如何在begin transaction中使用insert和delete查询并在c#中提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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