Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (MySqlConnection connection = new DBConnection().Connect())
- {
- using (MySqlCommand command = new MySqlCommand())
- {
- command.Connection = connection;
- command.CommandText = "INSERT IGNORE INTO competition_rounds (round_id, season_id, `name`)
- VALUES (@round_id, @season_id, @round_name)";
- command.Parameters.Add("@round_id", MySqlDbType.Int32).Value = round.Id;
- command.Parameters.Add("@season_id", MySqlDbType.Int32).Value = round.seasonId;
- command.Parameters.Add("@round_name", MySqlDbType.VarChar).Value = round.Name;
- command.ExecuteNonQuery();
- return Convert.ToInt32(command.LastInsertedId);
- }
- }
- instance 1 -> fire round insert -> return 3
- instance 2 -> fire round insert -> return 3
Add Comment
Please, Sign In to add comment