Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
McNeish Book and sample data access?
Message
De
11/09/2004 17:39:32
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00941275
Message ID:
00941370
Vues:
10
Sergey,

>Is there a way to retrieve actual OLE DB provider error info or any other meanigful error info instead of guessing?

Yeah, I suppose I should have said to wrap the ExecuteReader() method in a try/catch and check out some of the properties of the OleDbException (like the Errors collection). That might've been a better reply. ;)

So, Leo, try this:
try
{
    OleDbDataReader Reader = Command.ExecuteReader();
}
catch (OleDbException ex)
{
    // put some code here to maybe display the ex.Errors collecion
    // or set a breakpoint in this catch and look at the various
    // properties in the debug window.
}
~~Bonnie



>>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?
>
>Hi Bonnie,
>
>Is there a way to retrieve actual OLE DB provider error info or any other meanigful error info instead of guessing?
Bonnie Berent DeWitt
NET/C# MVP since 2003

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

Click here to load this message in the networking platform