473,322 Members | 1,610 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,322 software developers and data experts.

Read data from dataSet

Fox
I have create a dataSet and two table (father and son table) and set a
relationship between them (call father_uid (int)).

Is there any simple way, that I can get the row data include father and son
table items.
(do not use dataGuid)
eq

father_uid, father_field1,father_field2,son_field1,son_field2
1 "ABCD" 123.00 "XXXX" 456.00
1 "ABCD" 123.00 "YYYY" 567.00
2 "DEFG" 567.00 "aaaa" 456.00
2 "DEFG" 567.00 "bbbb" 567.00
2 "DEFG" 567.00 "cccc" 999.00

Thank for the help.
Nov 16 '05 #1
9 4351
Fox,

Normally you should be able to get it using the getchildrows
http://msdn.microsoft.com/library/de...drowstopic.asp

or/and
the getparentrow
http://msdn.microsoft.com/library/de...ntrowtopic.asp

I hope this helps

Cor
Nov 16 '05 #2
Fox
Thank you for your reply. It is work for normal dataSet, but don't work for
ds( read XML file). Finally thank you for you support. It is quite useful
for me.

Best Regards
Fox
"Cor Ligthert" <no************@planet.nl> ¼¶¼g©ó¶l¥ó·s»D:uH**************@tk2msftngp13.phx.g bl...
Fox,

Normally you should be able to get it using the getchildrows
http://msdn.microsoft.com/library/de...drowstopic.asp

or/and
the getparentrow
http://msdn.microsoft.com/library/de...ntrowtopic.asp

I hope this helps

Cor

Nov 16 '05 #3
Fox,

Did you write that dataset before you read it with the overloaded method to
write the schema as well?

Cor
Nov 16 '05 #4
Fox
No, I just load the XML to the dataSet. But I have the schema w/o use it.
Thank you very much for your help.

"Cor Ligthert" <no************@planet.nl> ¼¶¼g©ó¶l¥ó·s»D:ej*************@TK2MSFTNGP15.phx.gb l...
Fox,

Did you write that dataset before you read it with the overloaded method
to write the schema as well?

Cor

Nov 16 '05 #5
Fox
The ture question. I have a XML and its schema.
I try to load the XML file into the dataSet and display on datagrid.
I find that It show pretty good on the datagrid.
So I want to retrive the data from dataSet to SQL server.
XML file something like
<Book_Rec>
<Books>
<Book>
<Name>Book Name</Name>
<Languages>
<Language>Chinese</Language>
<Language>English</Language>
</Languages>
<Prices>
<Price><Currency>HKD</Currency><Amount>100</Amount></Price>
<Price><Currency>USD</Currency><Amount>20</Amount></Price>
</Prices>
</Book>
<Book>
<Name>Book Name2</Name>
<Languages>
<Language>English</Language>
</Languages>
<Prices>
<Price><Currency>HKD</Currency><Amount>500</Amount></Price>
<Price><Currency>USD</Currency><Amount>70</Amount></Price>
</Prices>
</Book>
</Books>
I wounder how dataSet make good Relation between Book->Language,
and Book->Price.
How the dataSet so good relationship between them?
</Book_Rec>
"Cor Ligthert" <no************@planet.nl> ¼¶¼g©ó¶l¥ó·s»D:ej*************@TK2MSFTNGP15.phx.gb l...
Fox,

Did you write that dataset before you read it with the overloaded method
to write the schema as well?

Cor

Nov 16 '05 #6
Fox,

I dont know how you are making this dataset.

Some links
http://msdn.microsoft.com/library/de...ationships.asp

For the way you want it is the "Nested" property important "IsNested" has to
be true

http://msdn.microsoft.com/library/de...d_elements.asp

I hope this helps,

Cor
Nov 16 '05 #7
Fox
I just direct load the XML data file to the dataSet
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXml("c:\\test.xml");
"Cor Ligthert" <no************@planet.nl> ¼¶¼g©ó¶l¥ó·s»D:eo**************@TK2MSFTNGP14.phx.g bl...
Fox,

I dont know how you are making this dataset.

Some links
http://msdn.microsoft.com/library/de...ationships.asp

For the way you want it is the "Nested" property important "IsNested" has
to be true

http://msdn.microsoft.com/library/de...d_elements.asp

I hope this helps,

Cor

Nov 16 '05 #8
Fox,

As far as I can see do you have in this dataset two tables, Books and
Languages which are saved nested

When you want to save them to SQL server you will have to have those tables
as well in that and update (in fact insert) them seperatly.

Normally first the books and than the languages.

I hope this helps?

Cor
Nov 16 '05 #9
Fox
Thank, I find the answer
"Cor Ligthert" <no************@planet.nl> wrote in message
news:O$**************@tk2msftngp13.phx.gbl...
Fox,

As far as I can see do you have in this dataset two tables, Books and
Languages which are saved nested

When you want to save them to SQL server you will have to have those tables as well in that and update (in fact insert) them seperatly.

Normally first the books and than the languages.

I hope this helps?

Cor

Nov 16 '05 #10

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

Similar topics

7
by: Marty | last post by:
Hi, Ok I use the OLEDBConnector and dataset to retrieve data from my Access DB. I have a problem to read/parse the dataset and I would like to know if I am using the right object to reach my...
0
by: Peter | last post by:
I am having a problem reading an Excel file that is XML based. The directory I am reading contains Excel files that can be of two types. Either generic Microsoft based or XML based. I am reading...
3
by: Programmer | last post by:
Hi all I wan't to know if i'm able to read mail from a mail server. My mail server is a pop3 server (UNIX) and i want to be able to get the mails from an aspx or an asmx. with out using external...
1
by: D. Shane Fowlkes | last post by:
How can I loop through the rows of a DataSet and send the "fields" to the Function as I've attempted to do in my code? Error is at "While dsLineItems.Read()" . I'm trying to construct a Sub which...
16
by: Adda | last post by:
If I cycle through the MdiChildActivate event of the parent form I can read text in a textbox on the child mdiform -- console.writeline(Me.ActiveMdiChild.Controls(1).Text) But if I have a sub...
0
by: ntuyen01 | last post by:
Hi All, I try to read the data from the excel, but I ran into this problem I have two excel files. file one.xls data inside like this: 1234 1234 1234 1234 abc-123 ...
0
by: tom | last post by:
When I try to read in a csv file it gives me this error message. 'Cannot update. Database or object is read-only.' If I change the extension to txt it processes just fine. I have googled all...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
1
by: Laila2008 | last post by:
Hi, I'm writing a String containing XML data to my browser. The XML data is well formed and the page opens up correctly but when I try to read this data from another page I get the following error:...
1
by: =?Utf-8?B?Y29uc3RhbnRpbg==?= | last post by:
I have problem with my code I need to read from Excel worksheet into dataset the problem is in this line oleda.Fill(ds). The data adapter should fill dataSet with data from Excel worksheet but...
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
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...
1
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...
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.