Vb.net Oracle error:Ora-00162 external dbid 17 is greater then max(16)

We are having a problem I am getting the above error when I try to connect to an oracle database.  I have no idea why this is happening. The connection works fine on my machine but when I build a setup project and install on another machine I get the error above.  Am I missing a step when I created the setup project?  My oracledatareader below works fine in debug mode, but not when install it.  I tried everything I can think of.  Any ideas?

Imports System.Data.OracleClient

  Dim oracleconn As OracleConnection = New OracleConnection("Data Source=xxxxxx.xxxxxx.xxx; User ID=xxxxxxxxx; Password=xxxxxxxx;") ' production database

  Function runtotal(ByVal sval As String, ByVal lhold As Label)
        Dim dr As OracleDataReader
        Dim cmd As OracleCommand
        SyncLock oracleconn
            Try
                oracleconn.Open()
                cmd = New OracleCommand(sval, oracleconn)
                dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
                While dr.Read
                    lhold.Text = dr.GetInt32(0)
                End While
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
            oracleconn.Close()
        End SyncLock
    End Function
tentavariousAsked:
Who is Participating?
 
existenz2Commented:
ORA-00162: external dbid length string is greater than maximum (string)
Cause: An external database name with too large a length field was passed in.
Action: Report the problem to your external transaction coordinator vendor.

Another person with the problem: http://www.dotnet247.com/247reference/msgs/33/166477.aspx

So it's an oracle problem caused by you databasename or tablename which is too long. In your case it's 17 characters long, while only 16 characters are allowed to be used.
0
 
tentavariousAuthor Commented:
Ok, but why does it work fine in my debug application and also it works with sql plus.  The only time it doesnt work is when i create the setup project and install the application on another computer.
0
 
existenz2Commented:
Are you connecting to the same database and are debug and release build settings the same?
0
 
tentavariousAuthor Commented:
Yes on the first one, and I am not sure on the second one.  Alls I do to release is change debug to release then build the project.  What settings if any would i have to set manually?
0
 
existenz2Commented:
None, that's why I am asking :). Try writing some parameters (database name, connection string, etc) and data into a txt file during both release and debug build and look if there are any differences. You could also write it to the event log.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.