Listing tables, then loop through data

  • Thread starter Thread starter Hugh Janus
  • Start date Start date
H

Hugh Janus

Hi all,

I have 2 problems, which are related. Hope someone can help!

I am using VB CF 2.0 with the SQLCE.

How do I populate a combo box with the names of all the tables that
the database contains? I am sure it records a dataadaptor, but I just
cannot get it working.

Second, does anyone have any code to share that lets me loop through
every record of a table to allow me to read the data in certain
columns?

TIA
 
Hi all,

I have 2 problems, which are related.  Hope someone can help!

I am using VB CF 2.0 with the SQLCE.

How do I populate a combo box with the names of  all the tables that
the database contains?  I am sure it records a dataadaptor, but I just
cannot get it working.

Second, does anyone have any code to share that lets me loop through
every record of a table to allow me to read the data in certain
columns?

TIA

Here's what I use -

"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE
TABLE_TYPE='TABLE' ORDER BY TABLE_NAME"

You can then, do a select from each table you find, to get at all the
low level data.


Hope this helps.


Richard Jones (Device Dev MVP)
www.binaryrefinery.com
 
Back
Top