0

I have scoured the internet ( well google anyway ) looking for a way to get a dbase dbf file into a DataTable using c# in VS Express 2013. Everything I'm seeing assumes that the data resides on a database - usually Access, and that the dbf file is from FoxPro. I have a stand-alone dbf file that is downloaded from a state website that I need ultimately to get into our SQL server database. If I can get the data into a DataTable then getting it into SQL Server should be easy. In Python, getting the dbf data into a DataFrame is a single line of code - assuming that you are importing simpledbf. Is there a similar process available for C#?

Thanks for any insights

pdhudgens
  • 11
  • 1
  • Have you tried [the code in this question](http://stackoverflow.com/questions/22361457/c-sharp-read-from-dbf-files-into-a-datatable), specifically the code in the actual question using OLEDB? – stuartd Apr 21 '17 at 12:39
  • Actually, the underlying structure of dBase and VFP are similar, and you probably CAN use the exact same connection processes via OleDB. Just make sure your connection is pointing to the PATH where the .dbf file is located. The Microsoft Visual FoxPro driver works very well if you have issues with other OleDb connections. – DRapp Apr 26 '17 at 17:40

1 Answers1

0

I feel somewhat chagrined at what I have discovered the answer to this question to be. I had been operating under the assumption that because this dbf file came from a state operated website, that it would therefore be older technology - ie dbase instead of FoxPro. I finally gave in and downloaded and installed the driver for MS Visual FoxPro, and specified a new connection string - and my code worked immediately. So I guess the lesson learned is to be certain what type of technology you're dealing with. Sorry for any hassles.

pdhudgens
  • 11
  • 1