必须为此操作打开连接 [英] Connection must be open for this operation

查看:794
本文介绍了必须为此操作打开连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的ERP中使用oracle和vs2010。我使用oracle连接,因为它是一个财务应用程序。

但是我发布了这个并且在页面中chking(点击保存按钮时间为2或者更多用户),

一个用户页面正在保存,其他人显示错误消息连接必须打开此操作。我在google中说这个,它说它是vs2010的问题。 />
任何人都对这个错误有所了解。

请帮助我

In my ERP am using oracle and vs2010.I used oracle connection since its a financial application.
But wen i published that and chking in page( clicking on the save button at time by 2 or more user),
one user page is saving and for others showing error message "Connection must be open for this operation".wen i chked this in google, its saying its the issue of vs2010.
anyone have any idea about this error.
please help me

推荐答案

检查你的代码是否正在打开一个连接



Check in your code that you are opening a connection

using (OracleConnection connection = new OracleConnection(ConnectionString))
{
  connection.Open(); //<-- must have
  //rest of code omitted
}


按照错误信息你应该打开连接:



As per the error message you should open the connection:

if (myConnection != null && myConnection.State == ConnectionState.Closed)
{
   myConnection.Open();
}


这篇关于必须为此操作打开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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