Here is my issue: This is my error. SQLException was unhandled. Below is the code. I know the info is right for SQL. Any thoughts:
Code:
Dim Conn As SqlConnection = New SqlConnection("Data source=MY DATASOURCE\SQL_NEW;Database=MY DATABASE;Integrated Security=True")
Dim objcommand As SqlCommand = New SqlCommand
With objcommand
.Connection = Conn
.CommandText = "Insert into MY_TABLE" & _
"(NAME,PHONE,ID)" & _
"VALUES (NAME,PHONE,ID)"
.Parameters.AddWithValue("@NAME", NAME)
.Parameters.AddWithValue("@PHONE", PHONE)
.Parameters.AddWithValue("@ID", ID)
End With
Try
Conn.Open()
objcommand.ExecuteNonQuery()
Catch(ex as SqlException)
MessageBox.Show(ex.Message.ToString(), "Error Message")
End Try
End