Update record

G

Guest

hi,

How could I update a record in the database?..my sql statement is: dim sql="update tblusers set password='" & txtnewpassword.text & "' where username='" & txtusername.text & "' and Password='" & txtoldpassword.text &"'"

This a change password form with btnOK and btnCancel button, with textboxes txtusername,txtoldpassword,txtnewpassword,txtconfirmpassword. Pls. show me the simplest way. txtusername.text has username public variable that was passed by the login form.
 
C

Cor Ligthert

Hi Mel,

There are a lot of ways, when I understand you well will this one probably
suits the most
Have as well a look for the "insert" when it are new ones.

You can look for the dataadapter too, however that is another method.

http://msdn.microsoft.com/library/d...ientsqldataadapterclassupdatecommandtopic.asp

I hope this helps?

Cor
How could I update a record in the database?..my sql statement is: dim
sql="update tblusers set password='" & txtnewpassword.text & "' where
username='" & txtusername.text & "' and Password='" & txtoldpassword.text
&"'"
This a change password form with btnOK and btnCancel button, with
textboxes txtusername,txtoldpassword,txtnewpassword,txtconfirmpassword. Pls.
show me the simplest way. txtusername.text has username public variable that
was passed by the login form.
 
A

Armin Zingler

Mel said:
How could I update a record in the database?..my sql statement is:
dim sql="update tblusers set password='" & txtnewpassword.text & "'
where username='" & txtusername.text & "' and Password='" &
txtoldpassword.text &"'"

This a change password form with btnOK and btnCancel button, with
textboxes
txtusername,txtoldpassword,txtnewpassword,txtconfirmpassword. Pls.
show me the simplest way. txtusername.text has username public
variable that was passed by the login form.


http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaccessingdatawithadonet.asp

http://msdn.microsoft.com/library/en-us/vbcon/html/vboriIntegratingDataVB.asp


ADO.Net group: microsoft.public.dotnet.framework.adonet

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
G

Guest

I read the links that you gave me but how could I reference my textboxes like txtoldpasssword,txtnewpassword and txtconfirmpassword? Instead @oldpassword can I write txtoldpassword.text?
 

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