troubleshooting Question

Object Reference not set Error

Avatar of Declan Basile
Declan BasileFlag for United States of America asked on
Visual Basic.NET
2 Comments1 Solution71 ViewsLast Modified:
In vb.net, I have a procedure declaration ...

        Private Sub SetSqlDataAdapter(ByRef da As SqlDataAdapter, strTableName As String)

And a call to it ...

        dap1 = New SqlDataAdapter(cmd1)
        Call SetSqlDataAdapter(dap1, "Returns")

dap1 is declared globally in the Form Class  ...

        Dim dap1 As New SqlDataAdapter

Why am I getting the exception "Object reference not set to an instance of an object" on the line that calls the procedure?
ASKER CERTIFIED SOLUTION
Declan Basile
IT

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros