Object not set to...

  • Thread starter Thread starter Brad Allison
  • Start date Start date
B

Brad Allison

I have an ODBC data adapter going to tables on an AS400. This works -
albeit slowly as our database is about 10 GB of information - in one program
that I am creating but now I am starting a new project and when I try to
create the data adapter I am getting "Object reference not set to an
instance of an object". I am using the wizard to create the adapter and I
have also opened Server Explorer and tried to drag fields onto the form.
Why would this be happening?

Thanks for any enlightenment.

Brad
 
We need to see your code, but have you added the dataAdapter.Fill code in
your page_load? The wizard does not do this for you. If you haven't, then
your DataSet doesn't have any data (i.e. no dataTables).
 
I always get that error when declaring something and forgetting to put "new"
in front...here is what I do ALL the time:

dim object1 as taco

instead of:
dim object1 as new taco

Taco being a class you are calling and trying to set or get properties from
(or run something)...

hth

Derek
 
I don't have any code yet. What I am doing is using the wizard to create an
Odbc DataAdapter and I select the connection, select the table, select the
fields where the wizard is creating the query string: (SELECT CMCUS#, CMNAME
from ARCUST WHERE (CMCUS#=?)) and then I hit Next to create the Select
Statement and this is where I am getting the error message. To me this is a
strange error because I am not programatically designing the adapter or the
connection. Because I have not gotten far enough to create the data
adapter, I have not yet been able to create the data set.

Thanks again for the help.

Brad
 
Hi Brad,

When you have questions about AS400 put that always in your subject.

That are questions for the "happy" few of us.

And I have one in mind, however he is free to answer and therefore I do not
call his name.

Cor
 
Back
Top