English 中文(简体)
retrieve FoxPro 7.0 database schema
原标题:

I need to obtain a list of tables in a Visual Fox Pro database. (7.0) This is what I m doing.... but it s not working or I m not doing it right...

DataFactory dataFactory = new DataFactory();

dataFactory.CreateOldStarbaseConnection();
dataFactory.OpenOldStarbaseConnection();
OleDbConnection oldStarbaseConnection = dataFactory.OldStarbaseConnection;

object[] arrRestrict = new object[] { null, null, "NewStarbase", null };

// Get the tables in the new Database
DataTable tblDbSchema = newStarbaseConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, arrRestrict);

// for each table in the new database
foreach (DataRow myDataRow in tblDbSchema.Rows)
{}
最佳回答

I recently wrote a code generation application for LINQ to VFP that gets the schema information. Here is how I got the schema.

using (OleDbConnection conn = new OleDbConnection(connectionString)) {
    conn.Open();
    DataTable tables = conn.GetSchema("Tables");
    DataTable columns = conn.GetSchema("Columns");
    DataTable dt = conn.GetSchema("Indexes");
    conn.Close();
}
问题回答

暂无回答




相关问题
XmlDocument.Validate ignore properties without [XmlIgnore]

I have a object that has a number of properties that aren t present in the xsd file. When doing XmlDocument.Validate is there a way I can tell it to ignore properties that are not present in the xsd ...

FOSS version of SQLCompare or something similar?

Actually, free is good enough, it doesn t have to be open source :) I m currently using the Schema Compare utility of VS2008, but it doesn t have a command line interface and has some other ...

How does Doctrine handle changes to the database schema?

In brief, what happens when you add a column to a table? What happens when you remove one? In more details, suppose you have the following: class User extends Doctrine_Record { public function ...

摘自XML Schema

我想要把复杂的XML化学仪编成册,并出口到C#文档中。

Using a schema other than dbo in LinqToSql Designer

Is there a way to specify in a data connection or the LinqToSql Designer a schema? Whenever I go to setup a data connection for LinqToSql there doesn t seem to be anyway to specify a schema and I ...

热门标签