[Mono-list] System.Data.OleDb

Marco Canini marco.canini@fastwebnet.it
Thu, 27 Nov 2003 21:39:32 +0100


Timothy Parez wrote:

> Hello,
>  
> I have an Access database which I access with System.Data.OleDb
> but I would like to enumerate all the tables in that database
>  
> How can I do this ?
>  
you have to call GetOleDbSchemaTable on your instance of OleDbConnection 
in this way:

DataTable dt = dbcon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new
			object[4] {null, null, null, "TABLE"});
foreach(Row r in dt.Rows) {
string tableName = r["TABLE_NAME"];
...
}

look at GetOleDbSchemaTable docs on msdn for more info.
btw this code won't work with mono since that method is not implemented.

MC