With cmd
.Connection = con
.CommandTimeout = 0
.CommandText = "INSERT INTO tableContacts (NameUser, Address, City, Phone, Fax, Note, Email) VALUES (@NameUser, @Address, @City, @Phone, @Fax, @Note, @Email)"
With .Parameters
.AddWithValue("@NameUser", txtName.Text)
.AddWithValue("@Address", txtAddress.Text)
.AddWithValue("@City", txtCity.Text)
.AddWithValue("@Phone", txtPhone.Text)
.AddWithValue("@Fax", txtFax)
.AddWithValue("@Note", txtNote.Text)
.AddWithValue("@Email", txtTo.Text)
End With
Try
cmd.ExecuteNonQuery()
Catch ex As Exception
End Try
.Dispose()
End With
无法找到问题所在。
所有调试器都说:
{" INSERT INTO语句中的语法错误。"}