You can use the visual FoxPro oledb provider for connecting
the .dbf file. Also it can be downloaded from the below url.
http://www.microsoft.com/en-in/download/details.aspx?id=14839
The below sample application shows how to get the data from
the .dbf file. I have created here a sample win form application which helps
you to select dbf file and shows the data in the grid.
private void btnBrowse_Click(object
sender, EventArgs e)
{
var result = openFileDialog1.ShowDialog();
txtFileName.Text = openFileDialog1.FileName;
try
{
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "Provider=vfpoledb;Data
Source=" + txtFileName.Text + ";Collating
Sequence=machine;";
conn.Open();
DataSet ds = new
DataSet();
OleDbCommand cmd = new OleDbCommand("Select * from " + Path.GetFileName(txtFileName.Text), conn);
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
catch (Exception
ex)
{
MessageBox.Show(ex.Message);
}
}