Click here to Skip to main content
15,904,653 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF and XML question Pin
Etienne_12330-May-09 1:59
Etienne_12330-May-09 1:59 
AnswerRe: WPF and XML question Pin
Pete O'Hanlon30-May-09 10:37
mvePete O'Hanlon30-May-09 10:37 
QuestionNumber updown control in WPF Pin
Nekkantidivya30-May-09 0:48
Nekkantidivya30-May-09 0:48 
AnswerRe: Number updown control in WPF Pin
ABitSmart30-May-09 1:41
ABitSmart30-May-09 1:41 
AnswerRe: Number updown control in WPF Pin
fjparisIII30-May-09 9:01
fjparisIII30-May-09 9:01 
QuestionWebbrowser control in Silver light Pin
Nekkantidivya29-May-09 19:43
Nekkantidivya29-May-09 19:43 
AnswerRe: Webbrowser control in Silver light Pin
Mark Salsbery31-May-09 9:20
Mark Salsbery31-May-09 9:20 
QuestionWPF and XML help Pin
Etienne_12329-May-09 3:56
Etienne_12329-May-09 3:56 
Hi
I know probably should've posted this on the XML message boards, but no one seems to reply there.
I have a database with 3 tables; Customers, Orders, and Order Details. The relationships between the tables are set up correctly; A Customer can have many Orders and a Order can have many Order Details. I added this database via the 'Add New Data Source' wizard om Visual Studio. I then use the following line of code to create an XML document from the dataset (dsNWind2k):
dsNWind2k.Customers.WriteXml("path\\asd.xml", true);
The 'true' is for 'writeHierarchy' which specifies that it will convert the Customers table to XML as well as all it's decendants. Now this is exactly what it does, except it doesn't give me a hierarchical xml structure the way I want it to. Instead, it converts all the fields in the Customers table to XML, then directly underneath that it generates the Orders. and once again underneath the Orders, the Order Details.
Is there a way to have it generate all the Customers, then within each Customer it should display the Orders associated with that specific Customer, and then within each Order it should display the Order Details associated with that specific Order.

Here's a sample of what it does at the moment:

..more customers..<br />
..more customers..<br />
<Customers><br />
  <CustomerID>NORTS</CustomerID> <br />
  <CompanyName>North/South</CompanyName> <br />
  <ContactName>Simon Crowther</ContactName> <br />
  <ContactTitle>Sales Associate</ContactTitle> <br />
  <Address>South House 300 Queensbridge</Address> <br />
  <City>London</City> <br />
  <PostalCode>SW7 1RZ</PostalCode> <br />
  <Country>UK</Country> <br />
  <Phone>(171) 555-7733</Phone> <br />
  <Fax>(171) 555-2530</Fax> <br />
</Customers><br />
..more customers..<br />
..more customers..<br />
<br />
..more orders..<br />
..more orders..<br />
<Orders><br />
  <OrderID>10614</OrderID> <br />
  <CustomerID>BLAUS</CustomerID> <br />
  <EmployeeID>8</EmployeeID> <br />
  <OrderDate>1995-08-29T00:00:00+02:00</OrderDate> <br />
  <RequiredDate>1995-09-26T00:00:00+02:00</RequiredDate> <br />
  <ShippedDate>1995-09-01T00:00:00+02:00</ShippedDate> <br />
  <ShipVia>3</ShipVia> <br />
  <Freight>1.93</Freight> <br />
  <ShipName>Blauer See Delikatessen</ShipName> <br />
  <ShipAddress>Forsterstr. 57</ShipAddress> <br />
  <ShipCity>Mannheim</ShipCity> <br />
  <ShipPostalCode>68306</ShipPostalCode> <br />
  <ShipCountry>Germany</ShipCountry> <br />
  </Orders><br />
..more orders..<br />
..more orders..<br />
<br />
..more order details..<br />
..more order details..<br />
<Order_x0020_Details><br />
  <OrderID>10599</OrderID> <br />
  <ProductID>62</ProductID> <br />
  <UnitPrice>49.3</UnitPrice> <br />
  <Quantity>10</Quantity> <br />
  <Discount>0</Discount> <br />
  </Order_x0020_Details><br />
..more order details..<br />
..more order details..


This becomes a problem when I want to bind this XML to my TreeView in WPF, because now Orders and Order Details will become Parent nodes, BUT I want it to be displayed as child nodes underneath Customers
Hope someone can help me
AnswerRe: WPF and XML help Pin
Mark Salsbery29-May-09 7:33
Mark Salsbery29-May-09 7:33 
AnswerRe: WPF and XML help Pin
Mark Salsbery29-May-09 8:35
Mark Salsbery29-May-09 8:35 
QuestionLink to Google Pin
mark_w_29-May-09 1:38
mark_w_29-May-09 1:38 
AnswerRe: Link to Google Pin
Pete O'Hanlon29-May-09 1:53
mvePete O'Hanlon29-May-09 1:53 
GeneralRe: Link to Google Pin
mark_w_29-May-09 2:12
mark_w_29-May-09 2:12 
GeneralRe: Link to Google Pin
Pete O'Hanlon29-May-09 2:28
mvePete O'Hanlon29-May-09 2:28 
QuestionHow to set scrolling property for canvas in WPF Pin
Nekkantidivya28-May-09 21:31
Nekkantidivya28-May-09 21:31 
AnswerRe: How to set scrolling property for canvas in WPF Pin
Pete O'Hanlon28-May-09 22:10
mvePete O'Hanlon28-May-09 22:10 
GeneralRe: How to set scrolling property for canvas in WPF Pin
#realJSOP29-May-09 6:04
professional#realJSOP29-May-09 6:04 
QuestionSilverlight 3 Release... Pin
Mark Salsbery28-May-09 11:34
Mark Salsbery28-May-09 11:34 
AnswerRe: Silverlight 3 Release... Pin
Pete O'Hanlon29-May-09 1:51
mvePete O'Hanlon29-May-09 1:51 
GeneralRe: Silverlight 3 Release... Pin
Mark Salsbery29-May-09 6:00
Mark Salsbery29-May-09 6:00 
GeneralRe: Silverlight 3 Release... Pin
Pete O'Hanlon29-May-09 8:41
mvePete O'Hanlon29-May-09 8:41 
QuestionNo EXE Generated [Resolved (but pissed off)] Pin
#realJSOP28-May-09 10:40
professional#realJSOP28-May-09 10:40 
QuestionRichTextBox UI elements animating?? Pin
_iobuf28-May-09 7:27
_iobuf28-May-09 7:27 
AnswerRe: RichTextBox UI elements animating?? Pin
_iobuf28-May-09 8:26
_iobuf28-May-09 8:26 
QuestionNeed help populating a treeview with XML Pin
Etienne_12328-May-09 6:34
Etienne_12328-May-09 6:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.