Exception has been thrown by the target of an Invocation
-
Hi, I have a background worker in my C# Winform who is responsible for inserting a record in a SQL table. At the same time I (as an user) can insert or delete a record in the same table while the background woerker is busy in the background. Now, when I perform some insert/delete in that table sometimes, I get Exception named "Exception has been thrown by the target of an Invocation". I think may be it was the time when two threads conflict by trying manipulating sql table at the same time. Can anyone give me any clue how to identify the problem and how to solve that problem please....
-
Hi, I have a background worker in my C# Winform who is responsible for inserting a record in a SQL table. At the same time I (as an user) can insert or delete a record in the same table while the background woerker is busy in the background. Now, when I perform some insert/delete in that table sometimes, I get Exception named "Exception has been thrown by the target of an Invocation". I think may be it was the time when two threads conflict by trying manipulating sql table at the same time. Can anyone give me any clue how to identify the problem and how to solve that problem please....
Hi, I can only guess but I had this problem once when using Reflection. When you call some method/constructor with reflection and an exception is thrown within this call than this kind of exception will come up.
-
Hi, I can only guess but I had this problem once when using Reflection. When you call some method/constructor with reflection and an exception is thrown within this call than this kind of exception will come up.
Perhaps you can catch the exception in code and take a look at the stack trace property on the exception object. Maybe that can help get you to a line of code that might lead you to the offending object. Jim