Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset

Reply
Thread Tools

Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset

 
 
Nedu N
Guest
Posts: n/a
 
      10-30-2003
Hi All,
I am facing problem in copying content of table from a untyped dataset into
to a table inside the typed dataset. I wanted to copy the data into typed
dataset in order to ease the further processing using typed references.

DataSet ds = getDataFromDB(); - i am getting the dataset ds from a
webservice

I have got MyXSD which decsribes the shcema for the table which i am getting
from the webservice
and i am trying to cast like following
MyXSD myds = (MyXSD)ds; ==> but giving me invalid exception error

And i tried copying the table from ds into myds like
myds.Tables[0] = ds.Tables[0];

but it is giving me error saying myds.Tables[0] is READ ONLY....

I tried ImportRow also but getting errors and i don't want to manually go
thru the rows and put into my Typed dataset..

Thanks for your help.

Nedu




 
Reply With Quote
 
 
 
 
Chris Taylor
Guest
Posts: n/a
 
      10-31-2003
Hi,

I believe (read that as I have not tried it!) that you can accomplish this
with the Merge member of the DataSet.

DataSet ds = getDataFromDB();
MyDataSet myds = new MyDataSet();

myds.Merge( ds );

For the cast to work your getDataFromDB() would have to actually be creating
a strongly typed dataset and merely return it as a generic DataSet.

Hope this helps

Chris Taylor
"Nedu N" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All,
> I am facing problem in copying content of table from a untyped dataset

into
> to a table inside the typed dataset. I wanted to copy the data into typed
> dataset in order to ease the further processing using typed references.
>
> DataSet ds = getDataFromDB(); - i am getting the dataset ds from a
> webservice
>
> I have got MyXSD which decsribes the shcema for the table which i am

getting
> from the webservice
> and i am trying to cast like following
> MyXSD myds = (MyXSD)ds; ==> but giving me invalid exception error
>
> And i tried copying the table from ds into myds like
> myds.Tables[0] = ds.Tables[0];
>
> but it is giving me error saying myds.Tables[0] is READ ONLY....
>
> I tried ImportRow also but getting errors and i don't want to manually go
> thru the rows and put into my Typed dataset..
>
> Thanks for your help.
>
> Nedu
>
>
>
>



 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference Between Typed Dataset and Untyped Dataset thomson ASP .Net 2 01-19-2005 08:16 AM
How can I add a row from a typed datatable to another instance of that typed datatable? Ersin Gençtürk ASP .Net 1 10-06-2004 01:11 PM
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net 2 10-31-2003 01:05 PM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net Datagrid Control 2 10-31-2003 02:43 AM



Advertisments