我需要获取Visual Fox Pro数据库中的表列表.(7.0)这就是我正在做的......但它没有用,或者我做得不对......
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)
{}
Run Code Online (Sandbox Code Playgroud)
我最近为LINQ to VFP编写了一个代码生成应用程序,用于获取架构信息.这是我如何获得架构.
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();
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1211 次 |
最近记录: |