c# - Task Parallel System.NullReferenceException or System.InvalidOperationException -


i getting error randomly (mostly it'll work these errors come) in of methods. errors are:

an exception of type 'system.nullreferenceexception' occurred in system.data.dll not handled in user code additional information: object reference not set instance of object.

and

an exception of type 'system.invalidoperationexception' occurred in system.data.dll not handled in user code
additional information: collection modified; enumeration operation might not execute.

  private void loadallcomboxdata()     {         var t1 = new task(() => loadincombobox1());         t1.start();                                  var t5 = new task(() => loadincombobox5());         t5.start();     }  private void loadincombobox1() {  this.loadincombobox1tableadapter.fill(this.eadbdataset.loadincombobox1); }                      private void loadincombobox5() {  this.loadincombobox5tableadapter.fill(this.eadbdataset.loadincombobox5); } 

what i'm planning accomplish simultaneously retrieve corresponding data database , load corresponding combobox.


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -