如果我static DB Connection
将一个装箱C# Web service
这个连接实例是在所有网络服务上共享的吗?那么,这样我会有问题吗?
连接时不允许更改“ConnectionString”属性(状态=正在连接)
我以这种方式获取实例:
public static OleDbConnection GetDatabaseConnection(string aConnectionString)
{
if (_dbConnection == null)
{
_dbConnection = new OleDbConnection(aConnectionString);
_dbConnection.Open();
}
else
{
_dbConnection.Close();
_dbConnection = new OleDbConnection(aConnectionString);
_dbConnection.Open();
}
Log.Logger.log("Aperta connessione al DB");
return _dbConnection;
}