"rik butcher" wrote:
> can any one tell me where the "Object Reference Not Set to an Instance of An Object" error is coming from in the code below? the procedure before logs on w/ no problem. i cant figure out which ref to which obj is getting lost.
> thanks for any help.
> ps. i ripped this code right out of another working program that basically does exactly the same thing. i had this in n-tiers but pulled it back to the code-behind cause i thought maybe some reference got lost.
> any help is definately appreciated
>
>
>
> Private Sub btnGetII_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetII.Click
> Dim myLogon, myPwd, sql, db As String
> myLogon = Session("Logon")
> myPwd = Session("Pwd")
> db = Session("db")
> Try
> Dim ds As DataSet
> sql = "select * from CMI_CLOCK_MESSAGES"
> Dim oracon As New OracleConnection("Server='" & db & "';Uid='" & myLogon & "';Pwd='" & myPwd & "'")
> oracon.Open()
> Dim myCmd As New OracleCommand
> myCmd.Connection = oracon
> myCmd.CommandText = sql
> myCmd.CommandType = CommandType.Text
> Dim da As New OracleDataAdapter(myCmd)
> da.Fill(ds)
> If ds.Tables(0).Rows.Count <= 0 Then
> Response.Write("Nothing found")
> Else
> DG1.DataSource = ds.Tables(0).Rows
> DG1.DataBind()
> End If
> Catch ex As Exception
> Response.Write(ex.Message)
> End Try
> End Sub
>
> **********************************************************************
> Sent via Fuzzy Software @
http://www.fuzzysoftware.com/ > Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...