interface don´t expose some fields

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luiz

    #1

    interface don´t expose some fields

    I'm constructing a class to database access using the
    following interface component :

    IDBDataAdapter my_i_DataAdapte r;
    ......
    The project has an instance of the class
    OdbcDataAdapter my_odbcDA, then I make this:

    my_i_DataAdapte r = my_odbcDA;

    but when I try to set the parameters, the
    interface don't expose the field "value",
    So I can not do this:

    this.my_i_DataA dapter.SelectCo mmand.Parameter s[0].value = variable ;

    How can I resolve this ?
    thanks.
  • Peter Bromberg [C# MVP]

    #2
    RE: interface don´t expose some fields

    Luiz,
    See the IDbCommand and IDbDataParamete r interfaces, which cover your
    SelectCommand and its parameter(s) respectively.
    Peter

    --
    Co-founder, Eggheadcafe.com developer portal:

    UnBlog:





    "Luiz" wrote:
    I'm constructing a class to database access using the
    following interface component :
    >
    IDBDataAdapter my_i_DataAdapte r;
    .....
    The project has an instance of the class
    OdbcDataAdapter my_odbcDA, then I make this:
    >
    my_i_DataAdapte r = my_odbcDA;
    >
    but when I try to set the parameters, the
    interface don't expose the field "value",
    So I can not do this:
    >
    this.my_i_DataA dapter.SelectCo mmand.Parameter s[0].value = variable ;
    >
    How can I resolve this ?
    thanks.

    Comment

    • Luiz

      #3
      RE: interface don´t expose some fields

      Hi Peter,

      thanks for your reply, but the solution was not to consult the documentation
      of
      the IDBCommand, IDbDataParamete r or IDataAdapter but to use the class
      DBAdapter ( without I ) that is a better implementation of the Interface
      IDataAdapater. That class is locate in System.Data.Com mon and expose more
      methods and properties. Other classes also has implementation in details like
      DBCommand, DBParameter...





      "Peter Bromberg [C# MVP]" wrote:
      Luiz,
      See the IDbCommand and IDbDataParamete r interfaces, which cover your
      SelectCommand and its parameter(s) respectively.
      Peter
      >
      --
      Co-founder, Eggheadcafe.com developer portal:

      UnBlog:

      >
      >
      >
      >
      "Luiz" wrote:
      >
      I'm constructing a class to database access using the
      following interface component :

      IDBDataAdapter my_i_DataAdapte r;
      .....
      The project has an instance of the class
      OdbcDataAdapter my_odbcDA, then I make this:

      my_i_DataAdapte r = my_odbcDA;

      but when I try to set the parameters, the
      interface don't expose the field "value",
      So I can not do this:

      this.my_i_DataA dapter.SelectCo mmand.Parameter s[0].value = variable ;

      How can I resolve this ?
      thanks.

      Comment

      Working...