Heritage d'une class Abstract

Résolu
kowalska Messages postés 33 Date d'inscription samedi 15 octobre 2005 Statut Membre Dernière intervention 4 janvier 2012 - 4 août 2008 à 10:21
kowalska Messages postés 33 Date d'inscription samedi 15 octobre 2005 Statut Membre Dernière intervention 4 janvier 2012 - 6 août 2008 à 11:52
Bonjour à tous,

Je suis actuellement perdu sur un souci de class

Voici le code de la 1er class

public abstract class DbFactory<T>
{
    protected DbConnection cnx;
    protected DbProviderFactory fac;
.....
    abstract protected T ReadObject(DbDataReader reader);

    abstract protected void GetOrdinal(DbDataReader reader);

    abstract protected string SqlFields
}

2eme Class

public class dzzStationsFactory : DbFactory<dzzStations>
{
public const string SQL_TABLE = "stations";
public const string SQL_FIELD_IDSTATION = "idstation";
public const string SQL_IDSTATION = SQL_TABLE + "." + SQL_FIELD_IDSTATION;
...

protected override void GetOrdinal(IDataReader reader)
    {
        if(posIdstation == -1)
        {
            posIdstation = reader.GetOrdinal(SQL_FIELD_IDSTATION);
            posFkIdenseigne = reader.GetOrdinal(SQL_FIELD_FK_IDENSEIGNE);
            posFkIdreseau = reader.GetOrdinal(SQL_FIELD_FK_IDRESEAU);
            posFkIdsecteur = reader.GetOrdinal(SQL_FIELD_FK_IDSECTEUR);
            posCodeImplant = reader.GetOrdinal(SQL_FIELD_CODE_IMPLANT);
            posNomStation = reader.GetOrdinal(SQL_FIELD_NOM_STATION);
            posTypeStation = reader.GetOrdinal(SQL_FIELD_TYPE_STATION);
            posAdrCp = reader.GetOrdinal(SQL_FIELD_ADR_CP);
            posAdrVoie = reader.GetOrdinal(SQL_FIELD_ADR_VOIE);
            posAdrVille = reader.GetOrdinal(SQL_FIELD_ADR_VILLE);
            posAdrRegion = reader.GetOrdinal(SQL_FIELD_ADR_REGION);
            posNomGerant = reader.GetOrdinal(SQL_FIELD_NOM_GERANT);
            posTel = reader.GetOrdinal(SQL_FIELD_TEL);
            posFax = reader.GetOrdinal(SQL_FIELD_FAX);
            posCourriel = reader.GetOrdinal(SQL_FIELD_COURRIEL);
            posFlagSupp = reader.GetOrdinal(SQL_FIELD_FLAG_SUPP);
            posNomCsm = reader.GetOrdinal(SQL_FIELD_NOM_CSM);
            posTelFixCsm = reader.GetOrdinal(SQL_FIELD_TEL_FIX_CSM);
            posTelPortCsm = reader.GetOrdinal(SQL_FIELD_TEL_PORT_CSM);
            posCommentaires = reader.GetOrdinal(SQL_FIELD_COMMENTAIRES);
            posCreePar = reader.GetOrdinal(SQL_FIELD_CREE_PAR);
            posModifiePar = reader.GetOrdinal(SQL_FIELD_MODIFIE_PAR);
            posCreeLe = reader.GetOrdinal(SQL_FIELD_CREE_LE);
            posModifieLe = reader.GetOrdinal(SQL_FIELD_MODIFIE_LE);
        }
    }
}

Et voici l'erreur

'dzzStationsFactory.GetOrdinal(): aucune méthode appropriée n'a été trouvé pour la subtitution

et

'dzzStationsFactory' n'implemente pas le membre abstract hérité DbFactory.<dzzStations>.GetOrdinal

Si vous pouviez m'aider sur ce petit soucis. merci d'avance.

2 réponses

jesusonline Messages postés 6814 Date d'inscription dimanche 15 décembre 2002 Statut Membre Dernière intervention 13 octobre 2010 29
4 août 2008 à 11:09
Bonjour,

la signature de la méthode GetOrdinal de ta classe abstraite est DBDataReader alors que ta classe concrete est IDataReader

<hr />Cyril - MVP ASP.net - MCPD ASP.net & MCTS SQL - Consultant indépendant
3
kowalska Messages postés 33 Date d'inscription samedi 15 octobre 2005 Statut Membre Dernière intervention 4 janvier 2012
6 août 2008 à 11:52
Merci, j'avais pas vu mon erreur
0
Rejoignez-nous