BChernick
Tue Nov 16 01:37:02 CST 2004
I've double checked my code for the customer screen and I'm pretty sure that
all fields are selected and bound. Beyond that, this article is nothing new.
I still can't help wondering why it's always the FirstName field (2nd in the
table) that's the one the system complains about. Could the order in which
they're bound mean anything? The txtFirstName control is the last one bound.
(Of course it's 2 in the morning here and I've got insomnia so everything I
do should be double checked as well :-)
"Sijin Joseph" wrote:
> Got your mail, i was just looking through the code and i got the same
> exception as you did, some research led me to this
>
>
http://support.microsoft.com/?kbid=833902
>
> I don't have the DB with me, so maybe you can try the solution suggested
> by the above KB, let me know if this helps you out, otherwise i'll
> continue investigating.
>
> Sijin Joseph
>
http://www.indiangeek.net
>
http://weblogs.asp.net/sjoseph
>
> B. Chernick wrote:
> > I've mailed 2 zip files to your hotmail address (minus the NOSPAM of course).
> > Please let me know if you haven't received them.
> >
> > Thanks,
> >
> > B. Chernick
> >
> > "Sijin Joseph" wrote:
> >
> >
> >>Hey Chernick,
> >>
> >>Can you mail me the solution file?, let me take a look.
> >>
> >>Sijin Joseph
> >>
http://www.indiangeek.net
> >>
http://weblogs.asp.net/sjoseph
> >>
> >>B. Chernick wrote:
> >>
> >>>The specific problem described in my original letter was caused by grossly
> >>>mistaken attempt to prevent a crash in the Load event (which did, but also
> >>>destroyed all binding, hence the null error messages on EndCurrentEdit.).
> >>>
> >>>As it stands now, I know how to edit existing records using Fill and
> >>>update. No problem. I know how to call AddNew from dataset that has
> >>>already been filled. No problem.
> >>>
> >>>The real problem as I see it now is: Is it possible to add records without
> >>>first calling Fill? I donâ??t want to read any records. I just want to add
> >>>one. The dataset has already been instantiated and bound.
> >>>
> >>>To add to my confusion the Fill method documentation refers to 'adding
> >>>tables' to the data set. Yet, if I do not call Fill and try to add a table
> >>>manually I get an error: â??A datatable named â??Customerâ?? already belongs to
> >>>this dataset.â?? (I suspect Iâ??m overlooking some key concept in dataset
> >>>manipulation. Still, given that this instance of a dataset already has a
> >>>specific data structure, I canâ??t see why I canâ??t manually add datarows.)
> >>>
> >>>"Sijin Joseph" wrote:
> >>>
> >>>
> >>>
> >>>>Yes one EndCurrentEdit is enough. I was thinking more of a debugging
> >>>>scenario. Anyways can you tell me if the field in which you are getting
> >>>>the exception is the field bound to the last textbox that you edit, or
> >>>>is it some other textbox?
> >>>>
> >>>>Sijin Joseph
> >>>>
http://www.indiangeek.net
> >>>>
http://weblogs.asp.net/sjoseph
> >>>>
> >>>>B. Chernick wrote:
> >>>>
> >>>>
> >>>>>What do you mean 'for all the bound textboxes'? I thought one EndCurrentEdit
> >>>>>call took care of all binding to a particular table?
> >>>>>
> >>>>>"Sijin Joseph" wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Hey Chernik,
> >>>>>>
> >>>>>>Just try calling EndCurrentEdit for all the bound textboxes, maybe the
> >>>>>>data from some other textbox is not getting back to the datatable..
> >>>>>>
> >>>>>>Sijin Joseph
> >>>>>>
http://www.indiangeek.net
> >>>>>>
http://weblogs.asp.net/sjoseph
> >>>>>>
> >>>>>>B. Chernick wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>I have a winform with a data adapter defined thru the wizard in the usual
> >>>>>>>fashion for editing a single table. I call AddNew and enter my data. I
> >>>>>>>then do a EndCurrentEdit call and the thing crashes, complaining about how a
> >>>>>>>null field is not allowed, even though that textbox is filled in and is bound
> >>>>>>>to that db field. (Furthermore, that field has an assigned default value in
> >>>>>>>the database.)
> >>>>>>>
> >>>>>>>Any suggestions?
> >>>>>>
>