Make Sure Connection is open when working with Local Context
This commit is contained in:
@@ -842,6 +842,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;
|
||||
@@ -974,6 +975,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyRODb?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (base.IsDirty)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -1026,6 +1028,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (IsNew)
|
||||
_LastChanged = ROFst.Add(cn, ref _ROFstID, _MyRODb, _ROLookup, _Config, _DTS, _UserID);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user