DataSet row to a Object Array Casting issue. Boolean

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

    #1

    DataSet row to a Object Array Casting issue. Boolean

    I have a class name OrderAckType and it has 3 variables
    public boolen orderSubmit;
    public string orderid;
    public string orderNumber;

    and i have to get the data from the database and basically this is my Query
    select Convert(bit,1) as orderSubmit, orderid,orderNu mber from order_master

    The data is returned in the DataSet.

    Now i want to move that data to this object.
    so i am doing this.

    OrderAckType[] oack2 = new OrderAckType[10];
    oOrderAckDS.Tab les[0].Rows.CopyTo(oa ck2,0);

    it cannot convert this bcos of the casting, in the Dataset the ordersubmit
    is "true" and datatype String.

    We can do a workaround by looping the Dataset for each row,, etc.
    Is there any direct way to do this.
    Thank you
    bhu


  • bhu

    #2
    Re: DataSet row to a Object Array Casting issue. Boolean

    This works fine.. sorry i was changing the code elsewhere...
    Sorry about this
    thanks
    bhu

    "bhu" <bhuvaneshwar@h otmail.comwrote in message
    news:%23u1aCqJv GHA.4384@TK2MSF TNGP04.phx.gbl. ..
    >I have a class name OrderAckType and it has 3 variables
    public boolen orderSubmit;
    public string orderid;
    public string orderNumber;
    >
    and i have to get the data from the database and basically this is my
    Query
    select Convert(bit,1) as orderSubmit, orderid,orderNu mber from
    order_master
    >
    The data is returned in the DataSet.
    >
    Now i want to move that data to this object.
    so i am doing this.
    >
    OrderAckType[] oack2 = new OrderAckType[10];
    oOrderAckDS.Tab les[0].Rows.CopyTo(oa ck2,0);
    >
    it cannot convert this bcos of the casting, in the Dataset the ordersubmit
    is "true" and datatype String.
    >
    We can do a workaround by looping the Dataset for each row,, etc.
    Is there any direct way to do this.
    Thank you
    bhu
    >

    Comment

    Working...