what's the problem with this ? any 1 can help me out..tnx in advance
Dim filePath As String
Try
filePath = Application.StartupPath() & "\" & DBFile
connection = New OleDb.OleDbConnection(ConnectionString & filePath)
connection.Open()
Dim command As OleDb.OleDbCommand = New OleDb.OleDbCommand
command.Connection = connection
'---set the user's particulars in the table---
Dim sql As String = "UPDATE enroll SET username='" & TextBox1.Text & "', " & _
" WHERE ID=" & _UserID
command.CommandText = sql
command.ExecuteNonQuery()
MsgBox("User added successfully!")
connection.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try