I’m new to c#. Recently I needed to use backgroundworker to execute stored procedure on a different thread on a windows form application and noticed that the execution time has doubled. I accidentally initialized backgroundworker’s DoWork event at run time even if I already set it at design time. I tried to remove initialization on my codes and the execution time became normal again.
I’m just curious why the execution time doubled. Any one knows why this thing happened?
Probably the DoWork event was registered twice, one time from code and one time from designer. Therefore it was executed twice.