hi
i am newbie in knowledge and also beginner in vb.net and it is my second question here
i am trying to make a software where users will register and then log on using their id
on the sign up form i plced some textboxes to get the user data
and through code i successfully create a new user but when i chek table in server explorer there is no new entry of user
plz tell me how can i update the database tables as the dataset is updated successfully. my code for creating a new user is
"Private Sub btnSignUp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSignUp.Click
' use sql connection to make a new transaction into database
Try
SqlConUp1.Open()
Dim dt As New DataTable
'dt = DsSecretsUp1.Tables("Users", "Secrets")
Dim newrow As DSSecrets.SecretsRow
newrow = DsSecretsUp1.Secrets.NewSecretsRow
newrow.Item("ID") = txtUserName.Text.Trim
newrow.Item("Name") = txtUserName.Text.Trim
newrow.Item("Address") = txtAddress.Text.Trim
newrow.Item("Email") = txtEmail.Text.Trim
newrow.Item("PhoneNo") = txtPhoneNo.Text.Trim
newrow.Item("password") = txtpassword.Text.Trim
DsSecretsUp1.Secrets.AddSecretsRow(newrow)
' the given two lines create run time error so its going to disabled
'now enable the binding data adapter to insert new record into database
' Me.BindingContext(DsSecretsUp1, "Secrets, Users").ResumeBinding()
If Not DsSecretsUp1.GetChanges(DataRowState.Added) Is Nothing Then
SqlDAUp.Update(DsSecretsUp1.GetChanges(DataRowState.Added))
End If
MsgBox("Sign up completed, you can now log on to your account ", vbOKOnly, "Congratulation")
Catch ex As Exception
MsgBox(ex.Message)
End Try
' show the login form and let user to logon to his account
frmLogin.Show()
Me.Close()
end sub"
i created the dataset and dataadapter by placing the objects on the form and the names of dataset are DsSecretsUp1 and the dataadapter is named sqldaUp
when i clicked on sign up button the msg showed to me that the registeration complete but in database the user data is not entered
the new data row is not added successfuully in hte database
i cant understand how to solv it
plz help
i am newbie in knowledge and also beginner in vb.net and it is my second question here
i am trying to make a software where users will register and then log on using their id
on the sign up form i plced some textboxes to get the user data
and through code i successfully create a new user but when i chek table in server explorer there is no new entry of user
plz tell me how can i update the database tables as the dataset is updated successfully. my code for creating a new user is
"Private Sub btnSignUp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSignUp.Click
' use sql connection to make a new transaction into database
Try
SqlConUp1.Open()
Dim dt As New DataTable
'dt = DsSecretsUp1.Tables("Users", "Secrets")
Dim newrow As DSSecrets.SecretsRow
newrow = DsSecretsUp1.Secrets.NewSecretsRow
newrow.Item("ID") = txtUserName.Text.Trim
newrow.Item("Name") = txtUserName.Text.Trim
newrow.Item("Address") = txtAddress.Text.Trim
newrow.Item("Email") = txtEmail.Text.Trim
newrow.Item("PhoneNo") = txtPhoneNo.Text.Trim
newrow.Item("password") = txtpassword.Text.Trim
DsSecretsUp1.Secrets.AddSecretsRow(newrow)
' the given two lines create run time error so its going to disabled
'now enable the binding data adapter to insert new record into database
' Me.BindingContext(DsSecretsUp1, "Secrets, Users").ResumeBinding()
If Not DsSecretsUp1.GetChanges(DataRowState.Added) Is Nothing Then
SqlDAUp.Update(DsSecretsUp1.GetChanges(DataRowState.Added))
End If
MsgBox("Sign up completed, you can now log on to your account ", vbOKOnly, "Congratulation")
Catch ex As Exception
MsgBox(ex.Message)
End Try
' show the login form and let user to logon to his account
frmLogin.Show()
Me.Close()
end sub"
i created the dataset and dataadapter by placing the objects on the form and the names of dataset are DsSecretsUp1 and the dataadapter is named sqldaUp
when i clicked on sign up button the msg showed to me that the registeration complete but in database the user data is not entered
the new data row is not added successfuully in hte database
i cant understand how to solv it
plz help