Groups | Blog | Home
all groups > dotnet ado.net > june 2005 >

dotnet ado.net : Obj Reference Error


(rbutch NO[at]SPAM coair.com)
6/30/2005 7:57:51 AM
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/
Kerry Moorman
6/30/2005 8:13:05 AM
rik,

Dim ds As NEW DataSet

Kerry Moorman


[quoted text, click to view]
(rbutch NO[at]SPAM coair.com)
6/30/2005 8:41:16 AM
thanks, i actually tried that too. im wondering if there's something else going on.
im using the schema name, but in the TNS names files it's listed as dbName.world. is it possible that its letting me log on, but not access any data??

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
AddThis Social Bookmark Button