Wednesday, March 28, 2012

how to ask for a tablename in ole db.

How do you ask in ole db which tables do exist or
if a table does exist ?
(Offcourse this should be RDBMS independant,
so I do not want to query 'system' tables or views).
ben brugman
(A pointer to another thread or webpage,
or the right keywords for google would be sufficient
anwser, thanks in advance).OLE DB supports several schema rowsets that return meta data. This and
other schema rowsets are documented in the OLE DB documentation. You can
find more info at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/oledbstartpage1.asp.
The C# example below displays the 'Tables' rowset in a datagrid.
object[] restrictions = { null };
DataTable schemaRowSet = myOleDbConnection.GetOleDbSchemaTable
(
System.Data.OleDb.OleDbSchemaGuid.Tables,
restrictions
);
this.dataGrid1.DataSource = schemaRowSet;
--
Hope this helps.
Dan Guzman
SQL Server MVP
"ben brugman" <ben@.niethier.nl> wrote in message
news:uxcP3G5$DHA.552@.TK2MSFTNGP11.phx.gbl...
> How do you ask in ole db which tables do exist or
> if a table does exist ?
> (Offcourse this should be RDBMS independant,
> so I do not want to query 'system' tables or views).
> ben brugman
> (A pointer to another thread or webpage,
> or the right keywords for google would be sufficient
> anwser, thanks in advance).
>
>

No comments:

Post a Comment