I am working with C# .NET and SQL Server 2008 R2, i need get some information from my SQL Server database and export it to a "dbf" file but i am not sure if i can do this by C# .NET or by a SQL server query
-
What is your definition of a "dbf" file?Fuck StackOverflow– Fuck StackOverflow2014-06-26 18:56:50 +00:00Commented Jun 26, 2014 at 18:56
-
DMason it's a DBase file..MethodMan– MethodMan2014-06-26 18:57:26 +00:00Commented Jun 26, 2014 at 18:57
-
msdn.microsoft.com/en-us/library/aa337084.aspxMethodMan– MethodMan2014-06-26 18:58:09 +00:00Commented Jun 26, 2014 at 18:58
-
"file.dbf" i think this are a "dbase file" or "database file" i am not sure about itjorge morera– jorge morera2014-06-26 18:59:11 +00:00Commented Jun 26, 2014 at 18:59
-
2What @DMason is saying, that in this context dbf could just be a three letter. Do you want to create a DBase file from data in your Microsoft SQL database?Black Frog– Black Frog2014-06-26 19:02:10 +00:00Commented Jun 26, 2014 at 19:02
1 Answer
Excerpt From Connect to a dBASE or Other DBF File on Microsoft :
The SQL Server Import and Export Wizard in SQL Server does not support importing from, or exporting to, dBASE or other DBF files. You can use Microsoft Access or Microsoft Excel to import the data from DBF files into an Access database or Excel spreadsheets, and then use the SQL Server Import and Export Wizard.
From C#, you can use OLE DB Provider and set the Extended Properties to dBASE III, dBASE IV, or dBASE 5.0, as appropriate.
Here is an example of a connection string using Microsoft Jet OLE DB 4.0 drive:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;
Extended Properties=dBASE IV;User ID=Admin;Password=;
Here is an overview what your C# program need to do:
- Connect to SQL Server
- Extract Data
- Open/Create connection to DBase using Ole DB Provider
- Write data to the new connection