DataAdapter Insert Command changes for no reason

C

Carlos Kirkconnell

I have dataset which has many changes performed by the user using a grid. I
previously built a DataAdapter using a commandbuilder. The commands built in
the data adapter are correct. But something strange happens when I update
the dataset. It seems that the insert command is changed during the call to
the update method in the dataAdapter. Previous to calling the update method,
the insertcommand is correct, but after the update command is generated, an
exception happens, and the insertcommand command text is changed in such a
way that some of the fields that form part of the primary key are missing,
which means that ado is trying to insert the a null value to the database.
Any idea of what is happening?
help will be really appreaciated.
 
M

Mohamoss

hi Carlos
Two thing i think of might be the reason of what you are noticing. did you
create your adaptor object using the code or did you use the visual
interface . if you used the second then it might be the reason so try to
remove that one and add it from code yourself . The other reason might be
that you are using some command builder object somewhere (or it may be
added to you if you use server explorer for example to create your adaptor
object).
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top