Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21451

Save data into database throught textboxes

$
0
0
Hi Guys,

Im sorry but im new with this, please help me how to save data into database using textboxes. Below are my codes:

If txtname.Text = "" Then
MsgBox("Please enter valid name", MsgBoxStyle.Critical)
txtname.Focus()
ElseIf txtpassword.Text = "" Then
MsgBox("Please enter valid password", MsgBoxStyle.Critical)
txtpassword.Focus()
Else
If Not TbluserTableAdapter1.Checkusername(txtusername.Text) = Nothing Then
MsgBox("User name is already taken", MsgBoxStyle.Critical)
cmdclear.PerformClick()
Else
TbluserTableAdapter1.CreateUser(txtusername.Text, txtname.Text, txtpassword.Text)
MsgBox("User account is successfully created", MsgBoxStyle.Information)
'cmdclear.PerformClick()
End If

I don't know why its not working, there is no error and its work fine with me but when i checked to database there is no data save even it says successfully created.

Hope someone will give me an answer.

Thanks!

Viewing all articles
Browse latest Browse all 21451


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>