You can also use OleDb Provider for reading .DBF files:
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection();
DataTable dt = new
DataTable();
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data Source=C:\dbfFilesFolder;Extended Properties=dBase IV";
conn.Open();
System.Data.OleDb.OleDbCommand comm = new System.Data.OleDb.OleDbCommand();
comm.CommandText = "SELECT * FROM C:\\dbfFilesFolder\\FileName";
comm.Connection = conn;
dt.Load(comm.ExecuteReader());
//After this, you have data from your DBF file in your DataTable;
conn.Close();
No comments:
Post a Comment