P
Paul [Paradise Solutions]
Hi All
This is in relation to my post on multiple DataAdapters, and is
cross-posted as both groups have relevence.
I have one class of shared functions, subs and variables (variables are
private). The idea is so that I have one class available to my whole
application without the need for multiple instances. All database calls
ensure connection object is closed in the Finally segment of my Try-Catches.
For those that have not read my other post I have been experiencing a
SQLCE data file sharing violation when updating tables (update on one
table works, update on next table doesn't).
What I was wondering if anyone could expand upon is:
If Class1 makes a call to SharedDataClass and uses 'AddOrderHeader'
(which then closes the database connection) and then Class2 makes a call
to SharedDataClass and uses 'AddOrderDetail' is there any chance that
the connection object is running in 2 threads (my code does not
programaticly use threading)?
I ask this as my Main form uses the DataAccessClass for retrieval and
this works. My order header class uses the DataAccessClass for insert
and select and this works. My OrderDetailClass uses the DataAccessClass
and consistently fails to insert/update (file share violation occurs
on ConnectionObject.Open, but no error occurs if I attempt to close it
{connection state is 'closed in command window}).
I used to use adapters, but believing they were the root of my issues
I've taken them out, but the problem remains.
As I've been working with databases in the past, I'm pretty sure my code
is good - especially as Brad Syputa[MS] didn't say there was anything
obviously wrong with it (see other post). This 'SHARED' angle is the
only one I have left.
Would appricate any help as with out full DB operation I'm in the myre...
Many thanks.
Paul
This is in relation to my post on multiple DataAdapters, and is
cross-posted as both groups have relevence.
I have one class of shared functions, subs and variables (variables are
private). The idea is so that I have one class available to my whole
application without the need for multiple instances. All database calls
ensure connection object is closed in the Finally segment of my Try-Catches.
For those that have not read my other post I have been experiencing a
SQLCE data file sharing violation when updating tables (update on one
table works, update on next table doesn't).
What I was wondering if anyone could expand upon is:
If Class1 makes a call to SharedDataClass and uses 'AddOrderHeader'
(which then closes the database connection) and then Class2 makes a call
to SharedDataClass and uses 'AddOrderDetail' is there any chance that
the connection object is running in 2 threads (my code does not
programaticly use threading)?
I ask this as my Main form uses the DataAccessClass for retrieval and
this works. My order header class uses the DataAccessClass for insert
and select and this works. My OrderDetailClass uses the DataAccessClass
and consistently fails to insert/update (file share violation occurs
on ConnectionObject.Open, but no error occurs if I attempt to close it
{connection state is 'closed in command window}).
I used to use adapters, but believing they were the root of my issues
I've taken them out, but the problem remains.
As I've been working with databases in the past, I'm pretty sure my code
is good - especially as Brad Syputa[MS] didn't say there was anything
obviously wrong with it (see other post). This 'SHARED' angle is the
only one I have left.
Would appricate any help as with out full DB operation I'm in the myre...
Many thanks.
Paul