Make Sure Connection is open when working with Local Context
This commit is contained in:
@@ -635,6 +635,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyRODb?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
@@ -753,6 +754,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyRODb?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (base.IsDirty)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -800,6 +802,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (IsNew)
|
||||
_LastChanged = RoUsage.Add(cn, ref _ROUsageID, _MyContent, _ROID, _Config, _DTS, _UserID, _MyRODb);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user