using System; using System.Data; using System.Data.OleDb; namespace VFUG_From_xBASE_to_.NET { public class OleDBExample { public OleDbDataReader DataReader; [STAThread] static void Main(string[] args) { OleDBExample ex = new OleDBExample(); ex.GetCustomer("ALFKI"); OleDbDataReader dr = ex.DataReader; if (dr.HasRows) { dr.Read(); Console.WriteLine(dr.GetString(dr.GetOrdinal("companyname"))); } else Console.WriteLine("No customers match."); Console.ReadLine(); dr.Close(); } public OleDBExample() { } public void GetCustomer(string CustomerID) { string mySelectQuery = "SELECT * FROM Customers where CustomerID = ?"; string myConnString = "Provider=VFPOLEDB;" + "Data Source=C:\\PROGRAM FILES\\MICROSOFT VISUAL FOXPRO 8\\SAMPLES\\NORTHWIND\\NORTHWIND.DBC;" + "Mode=Share Deny None;" + "Extended Properties=\"\";" + "User ID=\"\";Password=\"\";" + "Mask Password=False;Cache " + "Authentication=False;" + "Encrypt Password=False;" + "Collating Sequence=MACHINE"; OleDbCommand myCommand = new OleDbCommand(); myCommand.CommandText = mySelectQuery; myCommand.Connection = new OleDbConnection(); myCommand.Connection.ConnectionString = myConnString; myCommand.Parameters.Add("@CustomerID",CustomerID); myCommand.Connection.Open(); DataReader = myCommand.ExecuteReader(); } } }HTH.