Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
McNeish Book and sample data access?
Message
De
11/09/2004 17:22:09
 
 
À
11/09/2004 11:30:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00941275
Message ID:
00941368
Vues:
9
Leo,

>I am getting an unhandled exception of 'System.Data.OleDb.OleDbException'occured in system.data.dll for the line:
>OleDbDataReader Reader = Command.ExecuteReader();
I don't usually use the DataReader (preferring the DataAdapter to Fill a DataSet) and I use SQL Server rather than VFP, but I'll try to help ... are you sure that your samples.dbc contains a table called Employees? And that it has the appropriate columns that you've got in your command?

~~Bonnie


>Getting closer - thanks for the help. I have moved a few more lines down in the code.
>
>I am getting an unhandled exception of 'System.Data.OleDb.OleDbException'occured in system.data.dll for the line:
>
>
>OleDbDataReader Reader = Command.ExecuteReader();
>
>
>as used below
>
>
>string ConnectionString = @"Provider=vfpoledb;Data Source=c:\datadotnet\vfp\bin\debug\samples.dbc";
>/// Create the connection
>OleDbConnection Connection = new OleDbConnection(ConnectionString);
>/// Open the connection, access the data and close the connection
>Connection.Open();
>string SelectCmd = "SELECT TOP 3 LastName, FirstName, Title FROM Employees ORDER BY employeeid";
>OleDbCommand Command = new OleDbCommand(SelectCmd, Connection);
>OleDbDataReader Reader = Command.ExecuteReader();
>
>
>Leo
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform