datagridview optimistic concurrency null problem

R

russganz

It seems to me there are real problems with the datagridview (along
with the detailsview and form view) control when using optimistic
concurrency with fields that can be null. Trying to use these controls
I have many times had the update not work with no error generated.
After much experimentation I have narrowed it down to how the Update
Command is generated.

To make optimistic currency work, the builder generated an update
statement with a WHERE clause which has each field matched on its
original value to ensure that the record will not be updated if any
field has been changed. If any original value is null no match is ever
found and no update is performed. Just to prove the point I created a
detailsview form to go against the Northwind Customers table. The
first record has a null Region so any update does nothing - no update
but no error msg. I then changed the UpdateCommand of the SQL Data
Source to Region is Null and the update failed. Also if I did not
check Optimistic Concurrency updates work.

Is there a way to get Optimistic Concurrency to work with null data. I
though that 'convertemptystringtonull' might do somthing for this
problem but it didn't. I'm also surprised that I did not see more
people having this problem. Am I missing something that is obvious?
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top