Re: Development envionment vs runtime??
From: Greg Burns (greg_burns_at_DONT_SPAM_ME_hotmail.com)
Date: 07/18/04
- Next message: Paul: "Re: PrimaryPrincipal Security Question"
- Previous message: Jay B. Harlow [MVP - Outlook]: "Re: Function that convert Hexadecimal to Binary?"
- In reply to: Stu: "Development envionment vs runtime??"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 18 Jul 2004 13:10:00 -0400
Stu,
I don't know Oracle, but where do you open your connection? Where are you
closing your datareader? Probably not relevant since you say it runs in IDE
anyways.
Greg
Dim ConOra As New OracleConnection("User
Id=USER;Password=PASSWORD;Data Source=orcl9i;")
Dim Sql As String = "select * from CCO_MOTD order by ID "
Dim cmd As New OracleCommand(Sql, ConOra)
Dim reader As OracleDataReader
Try
ConOra.Open()
' Execute command, create OracleDataReader object
reader = cmd.ExecuteReader()
While (reader.Read())
Message(reader.GetDecimal(12)) = reader.GetString(0)
MaxMessage = reader.GetDecimal(12)
Console.WriteLine("MSG: " + Message(MaxMessage))
End While
Catch ex As Exception
MsgBox(ex.ToString)
Finally
If Not reader Is Nothing AndAlso Not reader.IsClosed Then
reader.Close()
If Not ConOra Is Nothing AndAlso Not ConOra.State =
ConnectionState.Closed Then ConOra.Close()
cmd.Dispose()
End Try
"Stu" <Stu@thynk.us> wrote in message
news:OhbNKB7aEHA.3512@TK2MSFTNGP12.phx.gbl...
> with the following code snippet
>
> Dim ConOra As OracleConnection = New OracleConnection()
> ConOra.ConnectionString = "User Id=USER;Password=PASSWORD;Data
> Source=orcl9i;"
> Dim Sql As String = "select * from CCO_MOTD order by ID "
> Dim cmd As OracleCommand = New OracleCommand(Sql)
> cmd.Connection = ConOra
> cmd.CommandType = CommandType.Text
> ' Execute command, create OracleDataReader object
> Dim reader As OracleDataReader = cmd.ExecuteReader()
> While (reader.Read())
> Message(reader.GetDecimal(12)) = reader.GetString(0)
> MaxMessage = reader.GetDecimal(12)
> Console.WriteLine("MSG: " + Message(MaxMessage))
> End While
> cmd.Dispose()
>
> Everyone runs happy and fine in the development envionment. When I create
> the install files, or run the .exe, it throws a 'Object reference not set
> to
> an instance of an object' error at the While(reader.Read()). This happens
> on other systems as well as my own.
>
> An interesting note, when running the exe file on a coworkers machine,
> who's
> setup is the same as mine (same version of .NET runtime, same version of
> VS.NET and same version of Oracle) - things run just fine when running
> the
> .exe file.
>
> Where do I go from here, is this a known issue, help ?
>
> Thanks much in advance...
>
> Stu
>
>
- Next message: Paul: "Re: PrimaryPrincipal Security Question"
- Previous message: Jay B. Harlow [MVP - Outlook]: "Re: Function that convert Hexadecimal to Binary?"
- In reply to: Stu: "Development envionment vs runtime??"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|