Check if connection state is closed before opening
This commit is contained in:
@@ -411,7 +411,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (!IsDirty) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
|
||||
_LastChanged = RoUsage.Add(cn, ref _ROUsageID, _MyContent, _ROID, _Config, _DTS, _UserID, myRODb);
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (!IsDirty) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
|
||||
_LastChanged = RoUsage.Update(cn, ref _ROUsageID, _ContentID, _ROID, _Config, _DTS, _UserID, ref _LastChanged, myRODb.RODbID);
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (IsNew) return;
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
|
||||
RoUsage.Remove(cn, _ROUsageID);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user