Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# connecting to Fox Free Table
Message
 
 
To
05/12/2002 10:07:10
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00729877
Message ID:
00730251
Views:
24
>I need to make a small c# app connect to a Fox Free Table just for reading purposes. Has anyone done anything like this? Any info would be appreciated.
>
>Thanks,
>Mark

Use the ADO.NET datareader for readonly access. Basic code using oledb provider:
public static void readVfpFreeTable() 
{
   string connection_string=@"Provider=VFPOLEDB.1;Data Source=c:\YourDirectoryPathToFreeTable";
   string sq = @"SELECT * from YourFreeTableName";
   OleDbConnection oCon = new OleDbConnection(connection_string); 
   OleDbCommand Cmd = new OleDbCommand();
   Cmd.Connection = oCon;
   OleDbDataReader RD;
   Cmd.CommandText = sq;
   oCon.Open();
   RD = Cmd.ExecuteReader();
   while (RD.Read())
   {
      //Process data 
   }
   RD.Close();
   oCon.Close();
}
Michael McLain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform