Ask the Expert

Problems using VB .NET with an Oracle database

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: