Make Sure Connection is open when working with Local Context
This commit is contained in:
@@ -614,6 +614,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyContent?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
@@ -731,6 +732,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyContent?.Update();
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (base.IsDirty)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
@@ -778,6 +780,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
using (SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"])
|
||||
{
|
||||
cn.Open();
|
||||
if (IsNew)
|
||||
_LastChanged = Detail.Add(cn, ref _DetailID, _MyContent, _ItemType, _Text, _Config, _DTS, _UserID);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user