troubleshooting Question

OracleConnection (OracleClient) works in VB.NET but not C#

Avatar of Solar_Flare
Solar_Flare asked on
Oracle DatabaseEditors IDEs
5 Comments1 Solution3041 ViewsLast Modified:
Hi all, I am using the Microsoft OracleClient 1.0.3300.0 from within VS 2005

I am having a bit of trouble connecting to the oracle DB from a C# application, the strange thing is that it works in VB!
THIS WORKS CORRECTLY:
----------------------------------------------------------------------
Dim conn As New System.Data.OracleClient.OracleConnection("SERVER=(DESCRIPTION=(ADDRESS=(COMMUNITY=xxx.world)(PROTOCOL=TCP)(Host=xxx)(Port=xxx))(CONNECT_DATA=(SID=xxx)));uid=xxx; pwd=xxx; Integrated Security=no;")
        Dim dt As New DataTable
        Try
            conn.Open()
            Dim DA As New System.Data.OracleClient.OracleDataAdapter("SELECT * FROM TABLENAME", conn)
            DA.Fill(dt)
        Catch ex As Exception

        Finally
            conn.Close()
        End Try
        Me.GridView1.DataSource = dt
        Me.GridView1.Databind()
----------------------------------------------------------------------

so with that working I created an app in C# with the following code (a simple translation from vb to c#):

----------------------------------------------------------------------
OracleConnection conn = new OracleConnection("SERVER=(DESCRIPTION=(ADDRESS=(COMMUNITY=xxx.world)(PROTOCOL=TCP)(Host=xxx)(Port=xxx))(CONNECT_DATA=(SID=xxx)));uid=xxx; pwd=xxx; Integrated Security=no;");
        DataTable dt = new DataTable();
        try
        {
            conn.Open();
            OracleDataAdapter DA = new OracleDataAdapter("SELECT * FROM TABLENAME", conn);
            DA.Fill(dt);
        }
        catch (Exception ex)
        {
        }
        finally
        {
            conn.Close();
        }
        this.GridView1.DataSource = dt;
        this.GridView1.DataBind();
----------------------------------------------------------------------

the error given is
      [System.Data.OracleClient.OracleException]      {"ORA-12638: Credential retrieval failed\n"}      System.Data.OracleClient.OracleException


any ideas why it would work in VB and not in C#?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros