connection.Open() produces error
I have downloaded and installed Oracle Provider for ADO.NET 9.2.0.1.0 Beta
which installed Oracle.DataAccess.dll (Version 9.2.0.0) on my client machine.
Within my C#.NET application I have set a reference to Oracle.DataAccess and to
the three namespaces (using Oracle.DataAccess; .DataAccess.Client;
.DataAccess.Types;). I then setup the connection as follows:
string connString = "User Id=adamsp;Password=xxx;Data Source=CGE3";
OraConnection conn = new OraConnection(connString);
string select = "select bipk from gtm.users " + "where username='" + userNameText.Text + "' and sysAccess_chk=1";
OraCommand cmd = new OraCommand(select);
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
try
{
conn.Open();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Debugging, I see that an exception is raised when the conn.Open() executes
(because I am pushed into the catch block). However, within that block the
exception object is null...I cannot determine what exception was raised. Nor
can I figure out another means to capture any Oracle exception. Looking at the
Connection properties in the Visual Studio Locals window, the connection
appears to be open and have no associated errors or problems. Can you suggest a
way to debug this or some other approach?