I receive this error
when I have this code:
Private Sub EditUsers()
Try
Dim dt As New DataTable
dt = ExecuteQuery("UPDATE tblUsers SET UserID = " & txtUserID.Text & ", UserName = '" & txtPassword.Text & "', Password = " &
txtPassword.Text & ", LastName = '" & txtLastName.Text & "', FirstName = '" & txtFirstName.Text & "', Position = '" &
txtPosition.Text & "', Address = " & txtAddress.Text & ", EmailAddress = " & txtEmailAddress.Text & ", SSS_ID = " &
txtSSS.Text & ", ContactNumber = " & txtPhone.Text & " ")
Call Clear()
MessageBox.Show("Record updated.", "User Record", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
txtUserName.Focus()
Call fillLvUsers()
Catch ex As Exception
MsgBox(ex.ToString)
txtUserName.Focus()
End Try
End Sub
Here's for the connection in mdlConnection.
Imports System.Data.SqlClient
Module mdlConnection
Private conn As New SqlConnection("Data Source=PC;Initial Catalog=Users;Integrated Security=True")
Public Function ExecuteQuery(ByVal command As String)
Dim sqlDA As New SqlDataAdapter(command, conn)
Dim sqlDataTable As New DataTable
Try
sqlDA.Fill(sqlDataTable)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Return sqlDataTable
End Function
End Module
What should I do? Please. I need help.
Everything else is working fine with my codes in Add and Delete.
Thank you!