VB.NET System.NullReferenceException

dataset, nullreferenceexception, vb.net

Solution

Well if it's failing on this line:

Me.OverTableAdapter.Adapter.SelectCommand.CommandTimeout = 60000

Then either:

- `Me.OverTableAdapter` is `Nothing`

- `Me.OverTableAdapter.Adapter` is `Nothing`

- `Me.OverTableAdapter.SelectCommand` is `Nothing`

(The second line you've shown us is irrelevant, as you're not getting that far.)

We can't tell based on what you've shown us, but you should be able to find out either in a debugger or by adding diagnostic logging.

Once you've worked out why it's failing, fixing it should be easy - it's almost certainly just a matter of initializing it properly. Compare your initialization of this adapter with the initialization of the other ones.

Problem

I have a VB.NET program that builds multiple datasets from 10 different databases. I am getting this Exception: ``` System.NullReferenceException: Object referenced not set to an instance of an object: ``` This error happens on the following lines: ``` Me.OverTableAdapter.Adapter.SelectCommand.CommandTimeout = 60000 Me.OverTableAdapter.Fill(Me.Dataset.Over, TodayDt, TodayEnd) ``` What does this Exception mean?

Original source

Related problems