J
JohnR
Hi, I'm trying to update a DBF file which I'm using VB.NET ODBC adapters,
commands and connections. I fill the dataset and databind the columns to
textboxes on my form. I can successfully view, delete and update the
records. The problem is when I try to add a new record.
Because I actually have a few controls bound to the same table I use
FORM.BINDINGCONTEXT to keep it all synced. So, using the
form.bindingcontext.addnew method. my textboxes clear and I enter 2 or 3 of
the 7 fields. When I hit my save button which does a
BindingContext.EndCurrentEdit and creates a new dataset (dsChanged) with
only the "changed" records, then I do a dataAdapter.Update(dsChanged) and it
throws an exception stating something about my first unentered field is
DBNull. and the database does not allow that. If I actually fill in the
field that I got the error on and try again, the error "moves" to the next
unentered field.
I've tried a couple of ways programatically "blank out" the fields in the
dsChanged dataset, but they remain (the debugger quickview confirms this) a
DBNull value.
How can I eliminate the DBNull values from my dataset programatically? Any
suggestions gratefully accepted.
commands and connections. I fill the dataset and databind the columns to
textboxes on my form. I can successfully view, delete and update the
records. The problem is when I try to add a new record.
Because I actually have a few controls bound to the same table I use
FORM.BINDINGCONTEXT to keep it all synced. So, using the
form.bindingcontext.addnew method. my textboxes clear and I enter 2 or 3 of
the 7 fields. When I hit my save button which does a
BindingContext.EndCurrentEdit and creates a new dataset (dsChanged) with
only the "changed" records, then I do a dataAdapter.Update(dsChanged) and it
throws an exception stating something about my first unentered field is
DBNull. and the database does not allow that. If I actually fill in the
field that I got the error on and try again, the error "moves" to the next
unentered field.
I've tried a couple of ways programatically "blank out" the fields in the
dsChanged dataset, but they remain (the debugger quickview confirms this) a
DBNull value.
How can I eliminate the DBNull values from my dataset programatically? Any
suggestions gratefully accepted.