473,320 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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


Nov 17 '05 #1
2 1057
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" <ne****@hotmail.com> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
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

Nov 17 '05 #2
Hi Nedu,

I noticed that you posted the same question in the
public.dotnet.framework.adonet group. One of our team members has replied
you on that thread, please check it when you have time.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: theWizK | last post by:
Hello all. I have noticed that when I generate a strongly-typed dataset from an xml schema that the DataTables that are generated have their constructors marked as internal. What this means is...
1
by: Nedu N | last post by:
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...
1
by: Somebody_Out_There | last post by:
Hello, I am trying to create a strongly typed datatable/dataset from an untyped dataset or datatable returned from a stored proc. The structure of the table cannot be static since the results...
3
by: Rakesh Rajan | last post by:
Hi, I have a method, which opens a connection, creates an untyped datable, fills it and returns it back. I have defined a typed datatable in my application as well. For some reasons, I have to...
2
by: Nedu N | last post by:
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...
7
by: Richard Myers | last post by:
Hello. I am getting an InvalidCastException which has revealed yet more of my ignorance. I cant believe i dont already know this and haven't encountered it before until now. I am consuming a...
4
by: Robert Bravery | last post by:
Hi All, I'm New to VS.net. Trying to figure out this new dataset thingy. Ok so I add a dataadapter with all the correct properties for a table. Then generate the dataset. Now open the dataset and...
1
by: Optimus | last post by:
Hi everyone, I currently develop an application in vs.net 2005 with vb.net. I was trying to use typed dataset and I've got in trouble for converting untyped dataset into Typed DataSet. I don't...
1
by: DazlerD | last post by:
Hi My program needs to insert records into a strongly typed dataset. The records are passed as a String. So far I have: Private Sub InsertIntoCustomersTable(ByVal XMLString As String) ...
1
by: zlf | last post by:
Hello As a known issue, WCF does not allow to transfer typed DataSet. So I have to copy all data from typed DataSet to untyped DataSet(same table names, column names and row data). What is the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.