Hi all,
I've got a class with a private DataSet member, and a void display()
method.
The display() method is *supposed* to take the DataSet for the class
(instance), new up a predefined for which has a DataGrid, slap the
DataSet onto the DataGrid, and set the form.visible to true.
I'm having trouble with a very early part of the process. The first
line of display() gives a runtime error:
int numRows = this.ClassDataSetMember.Tables["tbl"].Rows.Count;
Primary exception:
"An unhandled exception of type 'System.NullReferenceException'
occurred in ***.dll"
Inner exception:
"Additional information: Object reference not set to an instance of an
object."
This runtime error occurs when the main code calls the object.display()
method.
What am I doing wrong? I thought "this" was the way to say "that owns
the line of code currently running" (or something like that).
How do I get my object's display() method to make use of it's own
object's data?
I'm sure I'm confused over something really stupid - thanks for any
suggestions!
cdj