Visual Fox pro database to Sql Server
-
hi Guys, I am analysing the architecture for creating the following: To load data from Visual Fox pro table into Sql table through C# Com+. Steps I am after : 1. Create a method to read the data from Fox pro and convert it into an xml file. 2. Read the XML file and load into the table in Sql Server. But I do not know which namespace to use to read data from Fox pro database and generate the xml file. Can you guys please help??? Thanks Sujit
happy coding!
-
hi Guys, I am analysing the architecture for creating the following: To load data from Visual Fox pro table into Sql table through C# Com+. Steps I am after : 1. Create a method to read the data from Fox pro and convert it into an xml file. 2. Read the XML file and load into the table in Sql Server. But I do not know which namespace to use to read data from Fox pro database and generate the xml file. Can you guys please help??? Thanks Sujit
happy coding!
In order to access FoxPro databases you have to use the OleDB data access classes. If you are familiar with the SQLClient namespace, all you need is to basically replace SQL with Ole in whenever you use anything like: SQLDBConnection --> OleDbConnection. You do have to pay attention when you create the connection string for your database. The rest should be pretty straight forward if you have the odbc drivers installed properly for the fox pro database that you intend to use. Good luck!
---- www.digitalGetto.com
-
hi Guys, I am analysing the architecture for creating the following: To load data from Visual Fox pro table into Sql table through C# Com+. Steps I am after : 1. Create a method to read the data from Fox pro and convert it into an xml file. 2. Read the XML file and load into the table in Sql Server. But I do not know which namespace to use to read data from Fox pro database and generate the xml file. Can you guys please help??? Thanks Sujit
happy coding!
XML is not a very convenient intermediary data-format in this case. You would find it simpler to use SQL-Server's SSIS (or DTS if you are using SQL-Server 2000). That would allow you to copy data from FoxPro directly into a SQL-Server table. Otherwise MS-Access linked-tables should be able to do the trick. If you do need to copy the data programatically then use the .net ODBC or OLEDB classes to read FoxPro tables. You will then be able to link a DataReader object (from your FoxPro table) to an instance of the SqlBulkCopy[^] class to quickly copy data. Regards Andy