none
Program Error HELP !!!! RRS feed

  • Question

  • I am using VB.Net 2003  and an Access dB

    All of a sudden my app has develooped an error in a place where I wasn't making any changes. (So I think)

    My problem is happening when I am trying to fill a dataset.  I have two tables.  Part Numbers and Serial Numbers.  I also created a dataset that contains both tables and a connection object.

    In my code I have the following:



    PNAdapter.SelectCommand.CommandText = "SELECT Batched, [Expiry Date], Location, Notes, [Part Description], [Part Number], QOH, Serialized, [Time Lifed] FROM Parts"
    PNAdapter.Fill(Join, "Parts")
    SNAdapter.Fill(Join, "Serials")

     

    the program is bombing on the first line, saying

    An unhandled exception of type 'System.NullReferenceException' occurred in School Board.exe

    Additional information: Object reference not set to an instance of an object.

    As far as I know, nothing changed with my dataset or my data adapter.

    I have tried to delete and recreate the data adapter and the Join dataset but still no change. I also verified the connection string.

    I created the Adapter from the toolbox and it also contains the commandtext statement above. If I try to comment out the statement that sets the command text in my code I get the following error.

    Additional information: The SelectCommand property has not been initialized before calling 'Fill'.

    I'm at a loss !!!   any help would be appreciated..

     

     

     

    Tuesday, October 3, 2006 3:13 PM

All replies

  • tatoo

     

    >Additional information: The SelectCommand property has not been initialized before calling 'Fill'.

     

    According to this you did not instantiate a command object for use with the Adapters!

    Ibrahim Malluf

    Tuesday, October 3, 2006 6:07 PM