No what you want to find and compare is the record you want to change so if say the user name is admin you will do something like the following. But the trick I used was to put a textbox field on the form. IF you don't want the user to see it so your app stays all 'pretty' just either change all the colors to the same as the form's background OR hide it (send to back) behind another control on the form. Then:
let's say your admin name is displayed in textbox1 and your hidden textbox is called textbox2 - oh and use one more to put the new password into or ever how you might want to do this.
-
if textbox1.text = textbox2.text then
-
Me.SettingsBindingSource.RemoveCurrent()
-
Me.Validate()
-
Me.SettingsBindingSource.EndEdit()
-
Me.TableAdapterManager.UpdateAll(Me.YourDataSourceNameHERE)
-
end if
-
' now add your new record back
-
Me.SettingsBindingSource.AddNew()
-
textbox2.text = "adminuser"
-
textbox3.text = "mynewpassword"
-
Me.Validate()
-
Me.SettingsBindingSource.EndEdit()
-
Me.TableAdapterManager.UpdateAll(Me.YourDataSourceNameHERE)
-
This isn't the prettiest way to do this but this is exactly how I hide what is going on behind the scenes when I encrypt a username, product key, and activation code when the user actually activates my software.
It is kind of quirky but this is what I came up with late one night after working on some code to do ALL the above for like 9 hrs.