My question is pretty much the exact same as Efficient way to bulk insert into Dbase (.dbf) files - Is there an efficient way to bulk insert into dbase IV dbf files? The source data is coming from SQL Server 2012. I have Visual FoxPro available but I'd like to do this programatically from C#.
相关问题
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
- Should I use static function in c# where many call
As mentioned in comment, if in VFP, you should be able to do quite easily by means of
The only other way I can think of that MAY work is as follows.
Then, in C# using the VFP OleDB, create a connection to the path AND include the .DBC database name. Then you might be able to do a select based on the VIEW name... and hopefully the .DBC will kick in, and open / get SQL connection handle, run the remote view query and return all the data to you.
Let me know if this guidance works for you.
One example to create table from existing within VFP's OleDB this also a simple "Create Table" command.
Example of simple insert-into with parameters to help prevent SQL-injection
a very good sample of build the command and parameters ONCE, then do for each row and execute to insert
Another that shows both insert AND update build context samples
Hopefully the above links show you a wide variety to implement creating and inserting into DBF files.
You can create whatever query from other database connection such as SQL, MySQL, etc and use a datareader or dataadapter.fill to download from one, loop into the VFP cycle insert and update the parameters... You'll see the examples and hopefully most are clear to follow.