Search code examples
c#.netconnection-stringfoxprovisual-foxpro

visual foxpro connection string


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


Solution

  • 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