Accessデータベースのテーブル一覧を取得する方法。
Using cnn As DbConnection = 省略 cnn.Open() Try Dim dt As DataTable dt = cnn.GetSchema("Tables", New String() {Nothing, Nothing, Nothing, "TABLE"}) For row As Integer = 0 To dt.Rows.Count - 1 For col As Integer = 0 To dt.Columns.Count - 1 Console.WriteLine("[{0},{1}]={2}", row, col, dt.Rows(row).Item(col).ToString) Next Next Finally cnn.Close() End Try End Using 'cnn
0 件のコメント:
コメントを投稿