So basically, I have an autoincremented primary key, so basically I set the
selectcommand, and then used SqlCommandBuilder to build the rest. The
problem is that when I do dataadapter's update to create new rows, it will
automatically insert the values of the row into the datatable, however,
since one of the fields is an autoincremented field, it has to be null on
the datarow. So after it inserts, it is still null on the datarow, while in
the database, it is whatever it's suppose to be, since it is determined
automatically. I can no longer edit the row until I restart the application.
So I tried to get around this by using DataAdapter's Fill to update the
values (after a Clear() ), unforunately, this gives me a
An unhandled exception of type 'System.NullReferenceException' occurred in
system.windows.forms.dll
Additional information: Object reference not set to an instance of an
object.
so does anyone have any similar experience and/or work around that can help
me? Thanks..