2 u010618015 u010618015 于 2013.07.22 10:38 提问

sybase数据库连接出现异常

该方法是用来连接sybase数据库的,有时候执行该是可以的,但是有时候执行该方法就会出现异常:
Connection to Sybase server has been lost. All active transactions have been rolled back .

代码:
public DataTable ExecuteReader(string query, string connstr)
{

        using (AseConnection conn = new AseConnection(connstr))
        {
            using (AseDataAdapter adapter = new AseDataAdapter(query, conn))
            {
                adapter.SelectCommand.CommandTimeout = 60 * 3;

                DataTable dt = new DataTable();
                adapter.Fill(dt);
                Command.SQL("Success");
                return dt;
            }
        }
    }

1个回答

weixin_40561105
weixin_40561105   2017.10.11 13:42
Csdn user default icon
上传中...
上传图片
插入图片