1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
   |  
    public string calculer_joueur_disc(string unite, string sport)
    {
        string connectionString = "xxxxxxxx";
        SqlConnection connection = new SqlConnection(connectionString);
        SqlDataReader reader = null;
        string lsligne = "0";
        try
        {
            string commandText = "nbreJoueur";
            SqlCommand command = new SqlCommand(commandText, connection);
            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.AddWithValue("@UNITEID", unite);
            command.Parameters.AddWithValue("@SPORTID", sport);
            SqlParameter ligne = new SqlParameter("@LIGNE", SqlDbType.Int);
            ligne.Direction = ParameterDirection.Output;
            command.Parameters.Add(ligne);
            connection.Open();
            lsligne = ligne.Value.ToString();
            return lsligne;
        }
        catch (Exception ex)
        {
            return "-1";
        }
        finally
        {
            connection.Close();
        }
    } | 
Partager