GetOleDbSchemaTable for SqlCe ?

  • Thread starter Thread starter Mark Johnson
  • Start date Start date
M

Mark Johnson

I would like to get a list of the Tables in a Database.
This is possible in OldDb with the use of
OleDbConnection.GetOleDbSchemaTable().

Since SQLCE-Query can read all .sdf files it should some be possible.

mj10777.de.eu
 
Open a connection to the database in question and execute the following SQL
statement:

SELECT * FROM MSysObjects WHERE Flags=33554432
 
This codes works very well, thank you for the Information.

Mark Johnson, mj10777.de.eu

string s_Tables[];

SqlCeDataAdapter DA_Schema = new SqlCeDataAdapter("SELECT * FROM
INFORMATION_SCHEMA.TABLES "+
"WHERE TABLE_TYPE = 'TABLE' "
,
// "ORDER BY TABLE_TYPE",
DB_Connection);

DB_SchemaTable = new DataTable();
DA_Schema.Fill(DB_SchemaTable);
s_Tables = new String[DB_SchemaTable.Rows.Count];
for (int i=0;i<DB_SchemaTable.Rows.Count;i++)
{
DataRow dr_Row = DB_SchemaTable.Rows;
s_Tables = dr_Row["TABLE_NAME"];
}
 
Have you found a way to to this withe ODBC, it seems to be a problem.
Mark Johnson, mj10777.de.eu
 
I'm not sure what you mean. There is no ODBC support on CF
The INFORMATION_SCHEMA metadata are not available on external OLE DB or ODBC
connections. It is specific to SQL CE
 
Back
Top