subclass DataRow problem

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

    subclass DataRow problem

    I would like to subclass the DataRow class:
    class CustomerMasterR ow : public System.Data.Dat aRow
    {
    public string CustomerName
    {
    get { return base.ItemArray( 1) ; }
    }
    }

    the idea being that each column in the row would be accessed thru a
    property.

    But I get a compile error right off the bat:
    No overload for method 'DataRow' takes '0' arguments

    can I encapsulate the DataRow the way I want to, so that I can use
    properties to access the columns of the row?

    thanks,
    -Steve

  • Elton Wang

    #2
    subclass DataRow problem

    Hi Steve,

    It suppose to be ItemArray[1].


    HTH

    Elton Wang
    elton_wang@hotm ail.com
    [color=blue]
    >-----Original Message-----
    >I would like to subclass the DataRow class:
    > class CustomerMasterR ow : public System.Data.Dat aRow
    > {
    > public string CustomerName
    > {
    > get { return base.ItemArray( 1) ; }
    > }
    > }
    >
    >the idea being that each column in the row would be[/color]
    accessed thru a[color=blue]
    >property.
    >
    >But I get a compile error right off the bat:
    > No overload for method 'DataRow' takes '0' arguments
    >
    >can I encapsulate the DataRow the way I want to, so that[/color]
    I can use[color=blue]
    >properties to access the columns of the row?
    >
    >thanks,
    >-Steve
    >
    >.
    >[/color]

    Comment

    Working...