Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataSet Errors

Status
Not open for further replies.

arrian

Programmer
Nov 11, 2003
93
CA
I've got some code that should just fill a dataset, transfer it into a DataTable, add the DataTable to another DataSet. I'm not sure why it's not working the error number I get is 91, and the description for it is 91. Very helpful... This is the code I'm using:
Code:
Dim dsRet As DataSet
        Dim dsTemp As DataSet
        Dim dtTemp As DataTable
        Try
            dsTemp = Connect("Select * from ShiftReport where ShiftCount = " & strKey)
            dtTemp = dsTemp.Tables(0)
            MsgBox(dtTemp.Rows.Count)
            dsRet.Tables.Add(dtTemp)
            dsTemp = Connect("Select * from TimesheetInfo where Entry = " & strKey)
            dtTemp = dsTemp.Tables(0)
            dsRet.Tables.Add(dtTemp)
        Catch ex As Exception
            MsgBox(Err.Number & ": " & Err.Number)
        End Try
        Return dsRet

Any ideas on what could be causing my problem would be greatly appreciated.
 
Ok, the error I get is "Object reference not set to an instance of an object".... And as I'm typing this, I just realised, I'm missiong a new for dsRet. Thanks, chmohan, making me look at my code to realise my stupid oversights is good! Thanks. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top