www.webdeveloper.com
Results 1 to 2 of 2

Thread: XML from SQL into Gridview (Friendly names)

  1. #1
    Join Date
    Aug 2010
    Posts
    34

    XML from SQL into Gridview (Friendly names)

    Hi there,

    I have data in an SQL database and have managed to display it in Gridview using .net

    The problem I need to overcome is to figure out how (Programatically) to display the xml data in friendly form.

    For testing purposes I am using the XML node item name of Pres1 and another one called pres2.

    I need the c# behind the aspx page to create an XML doc from the SQL database and then overide the existing grid cell (19) with the correct name.


    Please note the XML document does not exist, the data is in a SQL database (Colomn "presentationData") with the connection string already in place.

    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    Hi,
    Pasre the XML file into a string, use repace on the nodes you want to change then name parse back to xml and databind to your gridview should do the trick.

    Here is example of parsing xml to string:

    http://www.netomatix.com/XmlFileToString.aspx

    Use:

    Code:
    string NewXMLString = XMLString.Replace("<OLDNODE>", "<NEWNODE>");
    then create a XMLReader to read the contents of the XMLString:

    http://msdn.microsoft.com/en-us/libr...(v=vs.95).aspx


    regards


    Ribs

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles