G
Guest
We have an app under development processing data from com port events. There
can be multiple com ports all sending data back to this one method on one
instance of a class “ldâ€. This method gets a db object associated
speciffically with THAT com port. The db objects wrap a datatable and a
tableadapter.
So if we have COM1, and COM3 in use we might have something like this
ld -> retrieves -> dataAdapterObjCOM1
dataAdapterObjCOM3
If I am running with only one com port all works fine. With more than one I
get many errors in the Designer class for the db stuff. All the db objects
are separate instance of objects specifically associated with that com port.
So no two threads should be trying to access the same db wrapper objects at
the same time.
The errors include:
The connection was not closed. The connection's current state is connecting.
When trying to insert with the adapater.
Note: I am testing for this connection state right before the insert line
and sometimes it will see it sometimes it won’t. I know doc says its for
future use but I am getting it now.
Object reference not set to an instance of an object. on DataTable NewRow()
I unplug the extra comport and everything works fine again.
Any suggestions?
can be multiple com ports all sending data back to this one method on one
instance of a class “ldâ€. This method gets a db object associated
speciffically with THAT com port. The db objects wrap a datatable and a
tableadapter.
So if we have COM1, and COM3 in use we might have something like this
ld -> retrieves -> dataAdapterObjCOM1
dataAdapterObjCOM3
If I am running with only one com port all works fine. With more than one I
get many errors in the Designer class for the db stuff. All the db objects
are separate instance of objects specifically associated with that com port.
So no two threads should be trying to access the same db wrapper objects at
the same time.
The errors include:
The connection was not closed. The connection's current state is connecting.
When trying to insert with the adapater.
Note: I am testing for this connection state right before the insert line
and sometimes it will see it sometimes it won’t. I know doc says its for
future use but I am getting it now.
Object reference not set to an instance of an object. on DataTable NewRow()
I unplug the extra comport and everything works fine again.
Any suggestions?