Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2007, 04:52 AM
GS GS is offline
Authorized User
 
Join Date: Sep 2003
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>[email protected]</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:[email protected] 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();

TIA
G
 
Old August 31st, 2007, 08:33 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.