ado code in aspx page versus class

  • Thread starter Thread starter GaryB
  • Start date Start date
G

GaryB

The following line of code works fine in my code-behind file for an aspx
page:

Dim HeadingRow As DataRow = dsGridReport.Tables(0).NewRow()

But when I transport that same code to a class and run it I get

"Object reference not set to an instance of an object"

Why?
Gary
 
Hi,

It means that most likely your dsGridReport DataSet is out of scope and was
set to Nothing. Hard to say why, but you could debug your code to see where
code resets this variable to Nothing
 

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

Back
Top