I am using getschema and simply trying to get names of tables within database data1.dbc. I have looked at the returned schmema info with the debugger and with the following code and can't see table names (which I know are in database). Have I used GetSchema correctly or am I not looking in the right place? Thanks!
string strCon = @"Provider=VFPOLEDB;Data Source=c:\users\me\My Documents\data1.dbc"; // this dbc exists
OleDbConnection cn = new OleDbConnection(strCon);
// Open Connection
cn.Open();
//DataTable schemaInfo = cn.GetSchema(); // available schemas
//foreach (DataRow row in schemaInfo.Rows)
//{
// string schema = (string)row[0];
// DataTable t = cn.GetSchema(schema);
// Form f = new ShowDataForm(t, schema);
// f.ShowDialog();
//}
public class ShowDataForm : Form
{
public ShowDataForm(DataTable tbl, string caption)
{
this.dgv = new System.Windows.Forms.DataGridView();
this.dgv.Location = new System.Drawing.Point(0, 0);
this.dgv.Dock = DockStyle.Fill;
this.dgv.DataSource = tbl;
this.Text = caption;
this.Controls.Add(this.dgv);
this.ClientSize = new System.Drawing.Size(1024, 768);
}
private System.Windows.Forms.DataGridView dgv;
}