hi

how do i update multiple rows? right now i can only update one row.
it works like this now:
user keys in customerIdNo and pwd1. a match in database will display pwd1 in textbox. textbox is databind to password field in access database. user can change the displayed pwd1 to pwd2 or to other pwd. when update button is pressed it updates the password field and changes pwd1 to what the user has changed.

BUT only a row is updated. i've a few rows where the password field values are pwd1. i want all pwd1 to be changed to the pwd that the user has changed to.

i use dataadapter and dataset. in dataadapter i wrote select* from table1 where customerIdNo=? and password=?

please help.
thank you!

I don't understand what you are trying to do. Do you have multiple passwords for the same CustomerIDNo? or do you store the customers password in multiple places?

if i am understanding right, you want to update the passwords for all the accounts that have userid as customerid1. If that is the case, then simple Update query woiuld do it.
Like following:
Update table1
set password= 'pwd2'
where customerIdNo = 'customerid1'

and after the query just do dataadapter.AcceptChanges();

Hope this helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.