views:

31

answers:

2

hello, i have to extract some data from a foxpro database. I found a sample app that extracts data from a sql server db and stores the connection string in the app.config file in the following format -

<connectionStrings>
    <add name="test"
       connectionString="Data Source=localhost\SQLExpress;Initial Catalog=test;Integrated Security=SSPI;Timeout=300;"
       providerName="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  </connectionStrings>

I would like to do the same thing in foxpro, but i don't know what to put for the providerName part of the configuration. i can get the connection string just fine. Does anyone have any idea what the provider name would be for visual foxpro?

Thanks

+2  A: 

You'll need to download the VFP Provider

Then according to connection strings the connection string will be

Provider=vfpoledb;Data Source=C:\MyDbFolder\MyDbContainer.dbc;Collating Sequence=machine;

The provider name would be System.Data.OleDb

Conrad Frix
that got me further along, but now i am getting the following error - The type name 'System.Data.OleDb' could not be found for connection string.i didn't reboot after installing the data provider, so i may try that next.
czuroski
A: 

I actually ended up having to use the following for the providerName -

System.Data.OleDb.OleDbConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

I am now getting the following error -

Specified Cast is Not Valid

but I am returning data, so I believe that is an unrelated issue. Thanks

czuroski