That error means you created a reference for an object, but never told the compiler what object that reference points to.

If you did this:
VB Code:
  1. Dim X As DataSet
  2. Debug.WriteLine (x.Tables.Count)

You would get that error. You declared X as a reference to a dataset, but haven't either initialized one(using New), or set X to an existing dataset.


VB Code:
  1. Dim X as [b] New [/b] DataSet
  2. Debug.WriteLine (x.Tables.Count)

So, my guess: You are missing a New operator somewhere(perhaps Shapes?), or you are setting a reference to something that wasn't created (perhaps it had no data in it)