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
 
Back
Top