Unhandled exception of type ‘Oracle.DataAccess.Client.OracleException’ occurred in oracle.dataaccess.dll

70 pts.
Tags:
Oracle 9i
Oracle Data Access
Oracle Database
Oracle error messages
An unhandled exception of type 'Oracle.DataAccess.Client.OracleException' occurred in oracle.dataaccess.dll Additional information: System error. Imports System.Data Imports Oracle.DataAccess.Client Public Class Form1 Inherits System.Windows.Forms.Form Dim objConnection As OracleConnection = New _ OracleConnection("User Id=system;Password=dax856;Data Source=DMS") Dim objDataAdapter As New OracleDataAdapter Dim objDataSet As DataSet = New DataSet Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Set the SelectCommand properties... objDataAdapter.SelectCommand = New OracleCommand objDataAdapter.SelectCommand.Connection = objConnection objDataAdapter.SelectCommand.CommandText = _ "Select * From EMP" objDataAdapter.SelectCommand.CommandType = CommandType.Text ' open the data base objConnection.Open() Please note using Tools for the menu I can connect to the Data Base selecting Connect To Data Base But failed if I choose the option Connect To Oracle Data Base Regards

Answer Wiki

Thanks. We'll let you know when a new response is added.

Have you installed the Oracle client software in addition to the ODP.NET (Oracle Data Provider for .NET)?
Can you connect from SQL*Plus?

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

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
  • Dax
    Hi Carlosdl. Thanks for responding. I can connect form SQL. It fails at line objConnection.Open() In .Net from the Tools menu I can connect using the Connect To Data Base option. If I try the option Connect To Oracle Data Base again from the Tools menu it fail to connect. Regards
    70 pointsBadges:
    report
  • Dax
    'DefaultDomain': Loaded 'c:windowsmicrosoft.netframeworkv1.1.4322mscorlib.dll', No symbols loaded. 'DataSetExample': Loaded 'C:Net2003projectsDataSetExamplebinDataSetExample.exe', Symbols loaded. 'DataSetExample.exe': Loaded 'c:windowsassemblygacsystem.windows.forms1.0.5000.0__b77a5c561934e089system.windows.forms.dll', No symbols loaded. 'DataSetExample.exe': Loaded 'c:windowsassemblygacsystem1.0.5000.0__b77a5c561934e089system.dll', No symbols loaded. 'DataSetExample.exe': Loaded 'c:windowsassemblygacoracle.dataaccess10.1.0.400__89b483f429c47342oracle.dataaccess.dll', No symbols loaded. 'DataSetExample.exe': Loaded 'c:windowsassemblygacsystem.data1.0.5000.0__b77a5c561934e089system.data.dll', No symbols loaded. 'DataSetExample.exe': Loaded 'c:windowsassemblygacsystem.xml1.0.5000.0__b77a5c561934e089system.xml.dll', No symbols loaded. 'DataSetExample.exe': Loaded 'c:windowsassemblygacsystem.drawing1.0.5000.0__b03f5f7f11d50a3asystem.drawing.dll', No symbols loaded. 'DataSetExample.exe': Loaded 'c:windowsassemblygacsystem.enterpriseservices1.0.5000.0__b03f5f7f11d50a3asystem.enterpriseservices.dll', No symbols loaded. 'DataSetExample.exe': Loaded 'c:windowsassemblygacsystem.enterpriseservices1.0.5000.0__b03f5f7f11d50a3asystem.enterpriseservices.thunk.dll', No symbols loaded. An unhandled exception of type 'Oracle.DataAccess.Client.OracleException' occurred in oracle.dataaccess.dll Additional information: System error. Unhandled Exception: Oracle.DataAccess.Client.OracleException ORA-12154: TNS:could not resolve the connect identifier specified at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) at Oracle.DataAccess.Client.OracleConnection.Open() at DataSetExample.Form1.Form1_Load(Object sender, EventArgs e) in C:Net2003projectsDataSetExampleForm1.vb:line 85 at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow) at System.Windows.Forms.Control.SetVisibleCore(Boolean value) at System.Windows.Forms.Form.SetVisibleCore(Boolean value) at System.Windows.Forms.Control.set_Visible(Boolean value) at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at DataSetExample.Form1.Main() in C:Net2003projectsDataSetExampleForm1.vb:line 5The program '[1720] DataSetExample.exe' has exited with code 0 (0x0).
    70 pointsBadges:
    report
  • carlosdl
    The problem seems to be that you are using a database alias that is not defined in your tnsnames.ora file. If you can connect from SQL*Plus, then I guess you have two different Oracle clients installed. The first thing to check would be the existence of more than 1 tnsnames.ora files. The correct tnsnames.ora file should have an entry for DMS in it. Something similar to this:
    DMS=
      (DESCRIPTION=
        (ADDRESS_LIST=
          (ADDRESS=(PROTOCOL=TCP)(HOST=OTNSRVR)(PORT=1521))
        )
        (CONNECT_DATA=
          (SERVER=DEDICATED)
          (SERVICE_NAME=ORCL)
        )
      )
    If you find more than one tnsnames file, you will need to copy the one that has the above definition for DMS to the location where the other file was found, because that is the Oracle client your program/IDE is using. Please check that, and post back with the results.
    70,220 pointsBadges:
    report

Forgot Password

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

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

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

Thanks! We'll email you when relevant content is added and updated.

Following