concurrency violation with bound control

G

Guest

Hi.

I'm sorry if this is a repost.
Please reply with existing links, if any.
I have a list box with a datatable as data source.

I edit an item from the list box (by changing the item
in the datatable) and call the update method() of
a data adapter.

My problem is I get a concurrency violation saying
no rows were affected.
 
W

W.G. Ryan eMVP

DarkLight - something sounds fishy. If you are getting a concurrency
exception, then you have a problem. Check what the proposed value is
compared ot the original one - somewhere in your code those values are
getting confused - unless of course someone edited it while you were using
it.

BTW, are you using a CommandBuilder? If you used the configuration wizard,
can you post the Update Code?
 
G

Guest

Thanks for your reply.

By patiently surfing the net and reading posts of fellow .NET developers,
I was able to come into one having the same problem as mine.

The cause is rather annoying.
The values I set for the command parameters was not in the order
they are declared in the SQL command text.

I PRESUMED that since parameter names were supplied, the order
in which they are added and set with a value would not matter anymore.

Apparently Microsoft had some other sense in mind...

Anyway, I have "corrected" my problem so this is now resolved...
 
C

Cor Ligthert

Darklight,

When you want complete help, than maybe you can than give information about
your question?

This is your question.
I'm sorry if this is a repost.
And?

Please reply with existing links, if any.
I have a list box with a datatable as data source.
And?

I edit an item from the list box (by changing the item
in the datatable) and call the update method() of
a data adapter.
And?

My problem is I get a concurrency violation saying
no rows were affected.

What I miss by instance:
Are you using OleDb or SQLclient.
Do you use a commandbuilder for the update or do you do it yourself
Do you use commandparameters
How did you change the datarow items
Did you use an acknowledge button for the update
Did you give the original datatable to the dataadapter

Just my thought

Cor
 

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