OBJ REF NOT SET TO AN INSTANCE OF AN OBJ

R

rbutch

guys ive been pouring over this for hours. i'm bascially copying code from another working asp.net program and i just cant see what im missing.
the logon procedure certainly finds the obj reference yet when i go to execute the sql query string, i keep getting this message. and im basically doin the exact same thing from the other program, just querying a different table, so why the ERROR??


here's the code if anyone can take the time to figure out what im missing.
i've looked at all the variables

Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click

sql = "select * from cont_payroll where empl_id='0322K' and ppe="15-oct-04'"
Try
Dim oracon As New OracleConnection("Server=atserver;Uid=rik;Pwd=winter_04")
Dim ds a new Dataset
oracon.Open()
ds.Clear()
ds.EnforceConstraints = False
Dim myCmd As New OracleCommand
myCmd.Connection = oracon
myCmd.CommandText = sql
myCmd.CommandType = CommandType.Text
Dim myDa As New OracleDataAdapter(myCmd)
myDa.Fill(ds)
If ds.Tables.Count = 0 Then
lblLogon.Text = "Nothing found"
ElseIf ds.Tables.Count >= 1 Then
Dg1.DataSource = ds.Tables(0)
Dg1.DataBind()

Else
End If
oracon.Close()

Catch ex As Exception
lblLogon.Text = ex.Message
End Try
End Sub
End Class

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
R

rbutch

i figured it out.
instead of: Dim ds as New Dataset
i was putting
Dim ds as Dataset

it's the little things

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top