title: Can't not use "INSERT INTO table VALUES() ON DUPLICATE KEY UPDATE" in VB.NET
body: <p>I just want to INSERT all of record to database if have duplicated primary, it will update primary. But I don't know why it alway say error "Missing semicolon (;) at end of SQL statement.". I know that in VB.NET there is no semicolor for sql statement, I think there has something wrong in my sql statement. when I remove part "ON DUPLICATE KEY UPDATE StudentID=@StudentID" It insert record OK. Please point to me whether I missed something</p>
  
  <p>Here is my code</p>
  
  <pre><code>Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
      cnn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\1_Project\Project_of_VB_Net\AccessDatabase\StudentDatabase.accdb"
      cmd.Connection = cnn
      For Each dr In dt.Rows
          cmd.CommandText = "INSERT INTO StudentData(ID,StudentName,StudentID,StudentClass) VALUES(@ID,@StudentName,@StudentID,@StudentClass) ON DUPLICATE KEY UPDATE StudentID=@StudentID"
          cmd.Parameters.AddWithValue("@ID", dr("ID"))
          cmd.Parameters.AddWithValue("@StudentName", dr("StudentName"))
          cmd.Parameters.AddWithValue("@StudentID", dr("StudentID"))
          cmd.Parameters.AddWithValue("@StudentClass", dr("StudentClass"))
          cnn.Open()
          cmd.ExecuteNonQuery()
          cnn.Close()
      Next
  End Sub
  </code></pre>