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!
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!