Make Sure Connection is open when working with Local Context
This commit is contained in:
@@ -559,6 +559,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyDocument?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
@@ -660,6 +661,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyDocument?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (base.IsDirty)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -704,6 +706,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (IsNew)
|
||||
_LastChanged = Entry.Add(cn, content, MyDocument, _DTS, _UserID);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user