title: C# Get insert id with Auto Increment
body: <p>I am using this method to insert a row into a table:</p>
  
  <pre><code>            MySqlConnection connect = new MySqlConnection(connectionStringMySql);
              MySqlCommand cmd = new MySqlCommand();
  
              cmd.Connection = connect;
              cmd.Connection.Open();
  
              string commandLine = @"INSERT INTO Wanted (clientid,userid,startdate,enddate) VALUES" +
                  "(@clientid, @userid, @startdate, @enddate);";
              cmd.CommandText = commandLine;
  
              cmd.Parameters.AddWithValue("@clientid", userId);
              cmd.Parameters.AddWithValue("@userid", "");
              cmd.Parameters.AddWithValue("@startdate", start);
              cmd.Parameters.AddWithValue("@enddate", end);
  
              cmd.ExecuteNonQuery();
              cmd.Connection.Close();
  </code></pre>
  
  <p>I hav also id column that have <code>Auto Increment</code> .
  And i want to know if it possible to get the id that is created when i insert a new row.</p>