c# - No tables returned from a SQL query. How could that happen? -


im having issue next code:

try         {             oledbconnection conn = new oledbconnection("provider=microsoft.ace.oledb.12.0;data source=database.accdb;jet oledb:database password=luzdary;");             oledbdataadapter data = new oledbdataadapter("select * articulos", conn);             dataset dset = new dataset();             conn.open();             data.fill(dset);             conn.close();             _articulos = dset.tables["articulos"];         }         catch(exception ex)         {             messagebox.show(ex.message);         } 

the try/catch there because vstudio 2010 installation isnt quite capable of detecting com exceptions somehow (had same issue creating database adox, exception uncaught, code kept on running responsively somehow, db never written disk).

the db has "articulos" table, , manually inserted records there, if foreach dataset, table named "table". getting frustrating :(

dset.tables[0].rows want.

this mean.

_articulos = dset.tables[0]; 

with that, _articulos.rows should populated records in database.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -