Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 31st, 2007, 04:52 AM
GS GS is offline
Authorized User
Join Date: Sep 2003
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Displaying XML format on ASP page

I have a field in a SQL Server database which holds XML (data type set to ntext).

When trying to display this in a label/ text field for example on an ASP.net field instead of getting the field in format:

<ns0:Resource xmlns:ns0=\"http://.EPM.TransferResources.BizTalk.Schemas.ResourcesGE N\"><ns0:EMPLID>816048L</ns0:EMPLID><ns0:START_DATE>2002-07-02T00:00:00.000000-00:00</ns0:START_DATE><ns0:FORENAME>Eric</ns0:FORENAME><ns0:SURNAME>Smith</ns0:SURNAME><ns0:INITIALS></ns0:INITIALS><ns0:TITLE>Mr</ns0:TITLE><ns0:EMAIL>EASMITH@.com</ns0:EMAIL><ns0:PRIMARY_LOCATION>SHB</ns0:PRIMARY_LOCATION><ns0:_STAFF>Y</ns0:_STAFF><ns0:ORG_LEVEL>003</ns0:ORG_LEVEL><ns0:DEPTID>F1817000</ns0:DEPTID><ns0:COST_CENTRE>TEFLSPCS</ns0:COST_CENTRE><ns0:DIVISION>DTTESBSS</ns0:DIVISION><ns0:RBS>NDERA.DTXXXDIV.DTTESBSS.DTTE LBDS.TEFLSPCS.F1817.F1817000</ns0:RBS><ns0:RATE_A>0</ns0:RATE_A><ns0:RATE_B>0</ns0:RATE_B><ns0:RATE_C>13.09</ns0:RATE_C><ns0:Meta_GUID>816048L</ns0:Meta_GUID></ns0:Resource>

I get the values returned as a string:

816048L2002-07-02T00:00:00.000000-00:00EricSmithMrEASMITH@.comSHBY003F1817000TEFLSPC SDTTESBSSNDERA.DTXXXDIV.DTTESBSS.DTTELBDS.TEFLSPCS .F1817.F18170000013.09816048L

How would I go about breaking up the string to get the values?

All I have is:

       string MessageBody = "";
        MessageBody = ds.Tables["ErrMessage"].Rows[0][14].ToString();

       //TODO: Need to workout how to display the xml well

        Label2.Text = MessageBody.ToString();

Reply With Quote
  #2 (permalink)  
Old August 31st, 2007, 08:33 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Cross post: http://p2p.wrox.com/topic.asp?TOPIC_ID=64584
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
error displaying asp page tanca Classic ASP Basics 5 November 28th, 2007 02:29 AM
Reg: displaying datase in xml format asp.net 2.0 sadiashoiab ADO.NET 0 April 19th, 2007 03:17 PM
displaying images in form page using ASP.net louie001 ASP.NET 1.0 and 1.1 Basics 0 February 23rd, 2006 06:26 AM
ASP page not displaying null values imercha Classic ASP Basics 1 January 19th, 2006 02:38 AM
displaying charts on an ASP page vik_asp Classic ASP Basics 1 August 6th, 2003 01:45 AM

All times are GMT -4. The time now is 04:00 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.