OK, heres my code: -
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
Dim sFN As String
Dim sLN As String
Dim sJT As String
Dim sUN As String
Dim sPW As String
sFN = txtFirstName.Text.ToString
sLN = txtLastName.Text.ToString
sJT = txtJobTitle.Text.ToString
sUN = txtUserName.Text.ToString
sPW = txtPassword.Text.ToString
Const sConnection As String = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=HelpdeskApp;Data Source=MARK"
Dim objConn As New System.Data.OleDb.OleDbConnection(sConnection)
objConn.Open()
Dim sSQL As String
Dim objCmd As New System.Data.OleDb.OleDbCommand(sSQL, objConn)
sSQL = "INSERT INTO STAFF (First Name, Last Name, Username, Password, Job Title, StaffID) VALUES (sFN, sLN, sUN, sPW, sJT, 1)"
Try
objCmd.ExecuteNonQuery()
Catch myException As System.Exception
Console.WriteLine(myException.Message)
End Try
txtFirstName.Text = ""
txtLastName.Text = ""
txtJobTitle.Text = ""
txtUserName.Text = ""
txtPassword.Text = ""
txtConfirmPassword.Text = ""
End Sub
No errors are thrown but nothing appears in the database!!??
Thanks for any help!!!
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
Dim sFN As String
Dim sLN As String
Dim sJT As String
Dim sUN As String
Dim sPW As String
sFN = txtFirstName.Text.ToString
sLN = txtLastName.Text.ToString
sJT = txtJobTitle.Text.ToString
sUN = txtUserName.Text.ToString
sPW = txtPassword.Text.ToString
Const sConnection As String = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=HelpdeskApp;Data Source=MARK"
Dim objConn As New System.Data.OleDb.OleDbConnection(sConnection)
objConn.Open()
Dim sSQL As String
Dim objCmd As New System.Data.OleDb.OleDbCommand(sSQL, objConn)
sSQL = "INSERT INTO STAFF (First Name, Last Name, Username, Password, Job Title, StaffID) VALUES (sFN, sLN, sUN, sPW, sJT, 1)"
Try
objCmd.ExecuteNonQuery()
Catch myException As System.Exception
Console.WriteLine(myException.Message)
End Try
txtFirstName.Text = ""
txtLastName.Text = ""
txtJobTitle.Text = ""
txtUserName.Text = ""
txtPassword.Text = ""
txtConfirmPassword.Text = ""
End Sub
No errors are thrown but nothing appears in the database!!??
Thanks for any help!!!