Make Sure Connection is open when working with Local Context
This commit is contained in:
@@ -602,6 +602,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyStage?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
@@ -718,6 +719,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyStage?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (base.IsDirty)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -764,6 +766,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (IsNew)
|
||||
_LastChanged = Check.Add(cn, ref _CheckID, _MyRevision, _MyStage, _ConsistencyChecks, _DTS, _UserID);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user