c# - DataAdapter Fill without command -


i'm trying fill dataadapter without using command. have dataset manually populated when try attach dataset dataadapter i'm gettin "the select command property has not been initialized before calling 'fill'". code has idea ?

thanks

oledbdataadapter ad1=new oledbdataadapter(cmd); oledbdataadapter ad2=new oledbdataadapter(cmd2); oledbdataadapter ad3 = new oledbdataadapter();  dataset ds = new dataset(); datatable db1=new datatable(); datatable db2=new datatable(); datatable db3 = new datatable(); ds.tables.add();  ad1.fill(db1); ad2.fill(db2); int i; foreach (datarow r in db2.rows) {     = 0;     foreach (datarow rc in db1.rows)     {         if (r[0].tostring() == rc[0].tostring())         {             = 1;         }     }     if (i == 0) { ds.tables[0].importrow(r); }  } ad3.fill(ds); 

i'm not entirely sure trying accomplish here, unclear description. have placed data in dataset with:

    ds.tables[0].importrow(r); 

also, data adapter of type has have @ least select command associated in order fill data table or data set.

could describe objective bit more clearly? trying add table dataset? fill external source? view rows imported?


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -