G
Guest
Hi!
I have a C# program developped with VS2003 and Enterprise Library June
2005. I converted it to VS2005B2, recompiled Enterprise Library to VS2005 and
now I'm stuck with a bug when my program closes.
The error messsage says :
ObjectDisposedException was unhandled
Safe handle has been closed
Source : "mscorlib"
Stack trace :
at System.Runtime.InteropServices.SafeHandle.DangerousRelease()
at System.Threading.RegisteredWaitHandleSafe.Finalize()
I've isolated the line that causes the problem. It is located in a method
that retrieves data from the database. Here is the code :
Database db = DatabaseFactory.CreateDatabase("Database Instance");
DBCommandWrapper dbCmd = db.GetSqlStringCommandWrapper(sqlCommand);
DataSet ds = db.ExecuteDataSet(dbCmd);
return ds;
the line I isolated is :
DBCommandWrapper dbCmd = db.GetSqlStringCommandWrapper(sqlCommand);
If this line is executed, the program will crash when I close it. Remark
that the query is executed on the database, and it returns correct values...
The problem is when the program exits...
Did someone ever encountered this problem..???
thanx in advance!
Philippe Trottier
I have a C# program developped with VS2003 and Enterprise Library June
2005. I converted it to VS2005B2, recompiled Enterprise Library to VS2005 and
now I'm stuck with a bug when my program closes.
The error messsage says :
ObjectDisposedException was unhandled
Safe handle has been closed
Source : "mscorlib"
Stack trace :
at System.Runtime.InteropServices.SafeHandle.DangerousRelease()
at System.Threading.RegisteredWaitHandleSafe.Finalize()
I've isolated the line that causes the problem. It is located in a method
that retrieves data from the database. Here is the code :
Database db = DatabaseFactory.CreateDatabase("Database Instance");
DBCommandWrapper dbCmd = db.GetSqlStringCommandWrapper(sqlCommand);
DataSet ds = db.ExecuteDataSet(dbCmd);
return ds;
the line I isolated is :
DBCommandWrapper dbCmd = db.GetSqlStringCommandWrapper(sqlCommand);
If this line is executed, the program will crash when I close it. Remark
that the query is executed on the database, and it returns correct values...
The problem is when the program exits...
Did someone ever encountered this problem..???
thanx in advance!
Philippe Trottier