[Mono-list] System.Data.OleDb

Timothy Parez tpsoftware@users.sourceforge.net
Thu, 27 Nov 2003 23:52:40 +0100


Thank you this exactly what I needed :-)
Can you imagine, I have tons of books, and none mentions this.

Timothy.
----- Original Message ----- 
From: "Marco Canini" <marco.canini@fastwebnet.it>
To: "Timothy Parez" <tpsoftware@users.sourceforge.net>;
<mono-list@lists.ximian.com>
Sent: Thursday, November 27, 2003 9:39 PM
Subject: Re: [Mono-list] System.Data.OleDb


> 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
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003