Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Exception has been thrown by the target of an Invocation

Exception has been thrown by the target of an Invocation

Scheduled Pinned Locked Moved C#
csharpdatabasehelptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    emran834
    wrote on last edited by
    #1

    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....

    R 1 Reply Last reply
    0
    • E emran834

      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....

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      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.

      J 1 Reply Last reply
      0
      • R Robert Rohde

        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.

        J Offline
        J Offline
        Jim Bennett
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups