VfpClient is simply a wrapper around the System.Data.OleDb classes with the goal of reducing pain points when accessing VFP data from .Net. Here is a list of some features included in VfpClient:
- Command Tracing
- Named Parameters
- VfpReader Enhancements
- ToXmlToCursorFormattedXml Array Extension Method
- ToXmlToCursorFormattedXml DataTable Extension Method
- DataTableDbcCreator
Getting Started
- Make sure your project targets x86. (Requirement when using VfpOleDb provider)
- Install VfpClient using NuGet
- Add the VfpClient diagnostics source for tracing command text.
1: <?xml version="1.0" encoding="utf-8"?>
2: <configuration>
3: <system.diagnostics>
4: <sources>
5: <!-- This source will allow you to see all VFP commands in the Output panel. -->
6: <source name="VfpClient" switchValue="Information" >
7: <!-- This listener will trace VFP commands to a text file and is intended for use in production when troubleshooting an issue. -->
8: <!--<listeners>
9: <add name="VfpClientTextWriterTraceListener"
10: type="System.Diagnostics.TextWriterTraceListener"
11: initializeData="c:\VfpClient.txt" />
12: </listeners>-->
13: </source>
14: </sources>
15: </system.diagnostics>
16: <!-- Need to include the following when using VfpClientTextWriterTraceListener -->
17: <!--<trace autoflush="true"/>-->
18: </configuration>
- VfpClient uses the VfpOleDb provider so the VfpOleDb installer is included in the NuGet package in case you don’t already have it installed. Additionally, the NuGet package includes an installer for VfpClient. This installer will install the VfpOleDb provider and modify system settings to setup Visual Studio Integration with VfpClient.
* Note: The installer needs to be run as an Admin. If you have problems running the install from Windows Explorer then try using the command prompt using “msiexec /i VfpClient.msi”
In Use
All you really need to know to use the VfpClient is that it has equivalent classes that can be found in the System.Data.OleDb namespace the only difference is that the VfpClient classes have a prefix of “Vfp” instead of “OleDb.”
Here is a simple example using VfpClient:

Visual Studio Integration
The Visual Studio Integration includes some minor changes to simplify the connection process and changed property pages to include VFP specific information.
Here is a view of some of the screens. The old screen is on the left the new is on the right.
- Added the "Visual FoxPro Data Client" data source so that you didn’t have to dig through the "<other>" selection.
- Simplified the Connection Properties so that you just need to specify a path.
- The Schema properties for Table, Fields, Views, and Stored Procedures are VPF specific values (using DBGETPROP).
Leave a Reply