小编Pos*_*sto的帖子

.net TransactionScope异常

我的代码是这样的

try
{
    using (TransactionScope iScope = new TransactionScope())
    {
        try
        {
            isInsertSuccess = InsertProfile(account);
        }
        catch (Exception ex)
        {
            throw;
        }

        if (isInsertSuccess)
        {
            iScope.Complete();
            retValue = true;
        }
    }
}
catch (TransactionAbortedException tax)
{
    throw;
}
catch (Exception ex)
{
    throw;
}
Run Code Online (Sandbox Code Playgroud)

现在发生的是,即使我的值为TRUE,也会随机发生TransactionAbortedException异常,但是在DB中插入/更新数据.

知道出了什么问题吗?

.net c# transactions

2
推荐指数
1
解决办法
4682
查看次数

C#:接口:2 个接口中的相同方法

我有 2 个接口,

    public interface I1
    {
       string GetRandomString();
    }

   public interface I2
   {
      string GetRandomString();
   }
Run Code Online (Sandbox Code Playgroud)

在课堂上,我植入了两者,

    public class ClassA : I1, I2
    {

      string I1.GetRandomString()
      {
         return "GetReport I1";
      }

      string I2.GetRandomString()
      {
          return "GetReport I1";
       }

    }
Run Code Online (Sandbox Code Playgroud)

现在在主方法中我想访问这些接口方法但无法访问

    static void Main(string[] args)
    {
        var objClassA = new ClassA();
        objClassA.GetRandomString(); // not able to do this, comile time error ... 
    }
Run Code Online (Sandbox Code Playgroud)

我知道,我缺少一些基本的 OOPS 东西,只是想知道这一点。有什么帮助吗?

c# interface

2
推荐指数
1
解决办法
7806
查看次数

youtube:在网站上使用youtube播放器

我不确定,但有没有办法使用YouTube视频播放器播放.flv文件,它存储在我自己的服务器中.

任何的想法 ?

youtube

1
推荐指数
1
解决办法
4374
查看次数

PHP:从手机上传照片

我需要制作一个支持从手机上传照片的PHP应用程序.任何想法我怎样才能做到这一点?

php mobile

1
推荐指数
1
解决办法
8487
查看次数

GMAP:从"多个位置"到"单个"到"位置"的路线

我正试图从多个POI使用谷歌地图,指向POI的方向.可以用GMAP完成吗?

我已经看到了我们可以提供多个目的地或中途停留的示例.但我希望有一个目的地和多个源位置.

任何的想法?

google-maps google-maps-api-3

0
推荐指数
1
解决办法
1274
查看次数

jQuery mousedown找到关于哪个事件被触发的确切元素

嗨,我有这个HTML代码

<th scope="col" class="" style="width: 13px;">
   <div class="some-handle"></div>
  <a href="javascript:__doPostBack('ucPWP$ctl03$3056$GVReport','Sort$3')">Passengers</a>
</th>
Run Code Online (Sandbox Code Playgroud)

并有这个JS代码

  $("Table tr th").mousedown(function (e) {  
    /*mousedown code goes here... */
    /* ignore if mousedown occur on div "some-handle" */
  }
Run Code Online (Sandbox Code Playgroud)

现在我试着抓住mousedown发生在具有"some-handle"类的div上.我能这样做吗?

jquery mouseevent

0
推荐指数
1
解决办法
9503
查看次数