Q

Problems using VB .NET with an Oracle database

Here our expert solves a problem a user was having in a VB .NET application connected to an Oracle database.

This Content Component encountered an error

I have to use VB .NET with my Oracle database. When I'm executing, I get an error: "An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll" Do you have any idea of what the problem may be and what I can do to rectify it? I am not entirely familiar with database technologies, however it is my understanding that you can connect to the various database formats such as MS Access, MySQL, SQL, and Oracle...

using the default ODBC drivers and the appropriate data adapter found in the .NET framework or a third-party implementation. However, you are going to experience performance gains if you are using the correct drivers and clients to communicate with your database. The known clients that are shipped with the .NET framework are as follows (after a brief glance into the Data namespace revealed)

System.Data.Odbc.OdbcDataAdapter;
System.Data.OleDb.OleDbDataAdapter;
System.Data.SqlClient.SqlDataAdapter;
System.Data.OracleClient.OracleDataAdapter;

I would recommend making a reference to the System.Data.OracleClient.dll in your project and then use the OracleDataAdapter. From your original question it appears that you may be attempting to access the Oracle database using the OleDb classes or drivers, which I believe will throw all sorts of exceptions. Check your connection and connection string to ensure you have the correct format. If you are using the standard connection string dialog choose the appropriate driver (SQL, OLEDB, or Oracle) and then in code use the associated namespace to manipulate your data.

Without a more detailed exception trace or some sample code to take the question into greater depth in context it would be hard for me to advice you further.

This was first published in August 2004

Dig deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close