Guest User

Untitled

a guest
Nov 21st, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using (MySqlConnection connection = new DBConnection().Connect())
  2. {
  3. using (MySqlCommand command = new MySqlCommand())
  4. {
  5. command.Connection = connection;
  6. command.CommandText = "INSERT IGNORE INTO competition_rounds (round_id, season_id, `name`)
  7. VALUES (@round_id, @season_id, @round_name)";
  8.  
  9. command.Parameters.Add("@round_id", MySqlDbType.Int32).Value = round.Id;
  10. command.Parameters.Add("@season_id", MySqlDbType.Int32).Value = round.seasonId;
  11. command.Parameters.Add("@round_name", MySqlDbType.VarChar).Value = round.Name;
  12. command.ExecuteNonQuery();
  13.  
  14. return Convert.ToInt32(command.LastInsertedId);
  15. }
  16. }
  17.  
  18. instance 1 -> fire round insert -> return 3
  19. instance 2 -> fire round insert -> return 3
Add Comment
Please, Sign In to add comment