Click here to Skip to main content
11,925,849 members (58,116 online)
Click here to Skip to main content
Add your own
alternative version


4 bookmarked

List of Tables of Microsoft Access DataBase

, 17 Feb 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
While dealing with databases, sometimes there is a need to get a list of tables in the application
If you are making an application where you need to deal with a database, the following piece of code can help you in getting a list of available tables in the database.

void table()
            string path = @"D:\....... your database file path";
            textBox1.Text = "";
            mycon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Persist Security Info=True");
            DataTable tables = mycon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
            foreach (DataRow row in tables.Rows)

Although there are many other methods, I have kept it simple for beginners.

Welcome to suggestions.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Pakistan Pakistan
I am programming learner.

You may also be interested in...

Comments and Discussions

QuestionViews Pin
evry1falls25-Apr-15 13:16
memberevry1falls25-Apr-15 13:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151126.1 | Last Updated 17 Feb 2011
Article Copyright 2011 by dontumindit
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid