Ejemplo n.º 1
0
        protected virtual async Task SaveGame()
        {
            var command = new SqlCommand("UPDATE [Records] set CorrectAnswer = @correct where Name = @Name",
                                         await MainFrm.GetSqlConnection());

            command.Parameters.AddWithValue("correct", correct);
            command.Parameters.AddWithValue("Name", MainFrm.UserId);
            var command1 = new SqlCommand("UPDATE [Records] set IncorrectAnswer = @incorrect  where Name = @Name",
                                          await MainFrm.GetSqlConnection());

            command1.Parameters.AddWithValue("incorrect", incorrect);
            command1.Parameters.AddWithValue("Name", MainFrm.UserId);

            await command.ExecuteNonQueryAsync();

            await command1.ExecuteNonQueryAsync();

            Close();
        }