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

N

Nedu N

Hi Techies,

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
 
N

Nedu N

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
 
T

Tian Min Huang

Hi Nedu,

Thanks for your post. I noticed that you posted this issue in several
queues. Please kindly note that one of my colleagues Kevin is investigating
this issue and will update your thread in the
"public.dotnet.framework.adonet" queue.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
C

Cor

Hi Nedu,
myds.Tables[0] = ds.Tables[0];

I dont believe this can work.
It seems if you want to add a table without his scheme on a already (or not)
existing place.

But maybe you just mean?
myds=ds.copy;

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top