title: How to get Insert ID after inserting data to MySQL
body: <p>I have a Mysql data table with the following details:</p>
  
  <pre><code>ID (int format) [AUTO_INCREMENT] 
  date (varchar) 
  ip (varchar)
  activate(varchar) 
  cdkey(varchar)
  
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
          Using SQLConnection As New MySqlConnection(ConnectionString)
              Using sqlCommand As New MySqlCommand()
                  With sqlCommand
                      .CommandText = "INSERT INTO software (`date`, `ip`, `activate`, `cdkey`) values (@date,@ip,@activate,@cdkey)"
                      .Connection = SQLConnection
                      .CommandType = CommandType.Text
                      .Parameters.AddWithValue("@ip", Label1.Text)
                      .Parameters.AddWithValue("@date", TextBox2.Text)
                      .Parameters.AddWithValue("@activate", "Yes")
                      .Parameters.AddWithValue("@cdkey", textbox4.Text)
  
  
  
                  End With
                  Try
                      SQLConnection.Open()
                      sqlCommand.ExecuteNonQuery()
                      iReturn = True
                      MsgBox("Display Last Insert ID here")
  
                  Catch ex As MySqlException
                      MsgBox(ex.Message.ToString)
                      iReturn = False
                  Catch ex As Exception
                  Finally
                      SQLConnection.Close()
                  End Try
              End Using
          End Using
          Return
      End Sub
  </code></pre>
  
  <p>it's working except I'm trying to get the id number from the database after this data is inserted. How do I do that?</p>