2010-01-13 2 views
0

Visual Fox Pro 데이터베이스에서 테이블 목록을 얻어야합니다. (7.0)이 내가 뭘하는지입니다 ....하지만 작동하지 않습니다 또는 내가 바로 그 일을 아니에요 ...FoxPro 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) 
{} 

답변

6

최근 스키마 정보를 가져옵니다 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(); 
} 
+0

고마워요 Tom! – OllieDoodle

관련 문제