*.dbf (dBase IV) ファイルを使用して、必要な地理データ (シェープファイル) を取得しようとしています。
奇妙なことに、dBase JET OleDb 4.0 プロバイダーは、そのようなオブジェクトは存在しないが、存在すると言っています。
証拠:
http://s21.postimg.org/eaj4h91uv/image.png
ソースコード:
static void Test()
{
const string path = "C:\\buildings.dbf";
string conStr = String.Format("Provider = Microsoft.Jet.Oledb.4.0; Data Source = {0}; Extended Properties = \"dBase IV\"", Path.GetDirectoryName(path));
var connection = new OleDbConnection(conStr);
connection.Open();
var command = new OleDbCommand(string.Format("select NAME from {0}", Path.GetFileName(path)), connection);
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
var str = (string)reader["NAME"];
}
}
connection.Close();
}
static void Main()
{
try
{
Test();
}
catch (Exception exc)
{
Console.WriteLine(exc);
}
}