Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Confusion in XML
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Confusion in XML

 Post Reply Post Reply Page  <12345 7>
Author
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 25 November 2003 at 5:49am

you asked "how" above my reply, i gave you an answer (although thats not the only way, just the easiest to understand from what i have run across)...

your option to "get into" datasets and making working with XML more .NET-like and less TextFile-like

Contribute to the working anarchy we fondly call the Internet
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 25 November 2003 at 10:23am

I'm working on it! I've build a website which completely runs on a Site.config file, so I can read it, but updating is a different story .

Gone..
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2003 at 10:01am

heh, talk about timing :)

http://aspnet.4guysfromrolla.com/articles/112603-1.aspx

for sure check it out

Contribute to the working anarchy we fondly call the Internet
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2003 at 11:49am

Thanks! That little piece of code changed the way I handle XML! Using datasets never really occurred to me..

Anyway, I have the following situation (New code always causes new problems)

<?xml version="1.0" encoding="utf-8" ?>

<Configuration>

<Cryptography>

<Key1> 710398740561298347056981239847105601928347019856029384719856 012934098</Key1>

<Key2> 091098703948701928709870981230986501928370651982706519283470 615347913</Key2>

</Cryptography>

</Configuration>

Now I want to retrieve the keys, so I made the following line of code:

objDataSet.Tables.Item("Cryptography").Columns("Key1").ToStr ing

This returns 'Key1', the name of the collum. How can I get the XML inner text, or the value? I've tried quite a few things, including the container.components, but it just won't work. Any ideas?

Gone..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2003 at 12:33pm
Try

objDataSet.Tables("Cryptography").Rows(0).Items("Key1")

(you need to increment 0 row for the row heres how to loop through)

Dim RowCount As Integer = objDataSet.Tables("Cryptography").Rows.Count

Dim i As Integer

For i = 0 To RowCount - 1
Dim value As String objDataSet.Tables("Cryptography").Rows(i).Items("Key1")

...
Next
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2003 at 12:39pm

 Fantastic. I forgot about the .Rows(0).. Anyway, thanks, now I can also update it the same way (little modified, but same idea)!

Gone..
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2003 at 12:47pm
This is great, the code I made requires 3 lines, and takes away all the XML node stuff. Really
Gone..
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2003 at 12:59pm

yeah, open that above xml file you posted in Visual Studio.NET

then click the "Data" tab on the bottom..... hey look! its a DataSet

Contribute to the working anarchy we fondly call the Internet
Back to Top
 Post Reply Post Reply Page  <12345 7>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.