Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 10th, 2006, 05:25 PM
bhu
Guest
 
Posts: n/a
Default 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,orderNumber 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.Tables[0].Rows.CopyTo(oack2,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


  #2  
Old August 10th, 2006, 08:25 PM
bhu
Guest
 
Posts: n/a
Default 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@hotmail.comwrote in message
news:%23u1aCqJvGHA.4384@TK2MSFTNGP04.phx.gbl...
Quote:
>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,orderNumber 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.Tables[0].Rows.CopyTo(oack2,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
>

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles