using System.Data.OleDb; public void GetOleDbSchema() { OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\myFolder\\myAccessFile.accdb;"); conn.Open(); DataTable schemaTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" }); conn.Close(); }
using System.Data.OleDb; public void GetOleDbSchema() { OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\myFolder\\myAccessFile.accdb;"); conn.Open(); DataTable schemaTable = conn.GetSchema("Columns", new string[] { null, null, "Employees", null }); conn.Close(); }This example connects to an Access database using the ACE OLEDB provider and retrieves a schema table containing information about all the columns in the "Employees" table. The package library used in these examples is System.Data.OleDb.