Solved

the getxml method used to get the xml d

Posted on 2014-07-25
1
311 Views
Last Modified: 2014-07-28
I am new to generating XML using vb.net. I have a SQL database and have a stored procedure which pulls out approximately 700 rows and has 5 columns.  I use a SQl dataadapter and then fill the data in the dataset
exampl

Dim 1dataset as DataDs = New DataDS

DataSession.Fill(1dataset , New SqlDataAdapter()  {MyData})
I use
dim strXML as string
strXML =MyData.GetXML()
Now my strXML has my data in  a xml from. But when I  pass this to my service and see the data in view source all the <> brackets become   &lt; &gt; passed remain in XML format.



How do iget the data set in an XML format



Regards without creating a file locally. Any help would be appreciated.

Regards

YRKS
0
Comment
Question by:ChanderMadhaviGmail
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
Comment Utility
You can use the System.Web.HttpUtility.HtmlDecode method to convert the encoded text back to XML.

HttpUtility.HtmlDecode Method (String)
http://msdn.microsoft.com/en-us/library/7c5fyk1k(v=vs.110).aspx

Imports System
Imports System.Web
Imports System.IO

Class MyNewClass
   Public Shared Sub Main()
      Dim myString As String
      Console.WriteLine("Enter a string having '&' or '""'  in it: ")
      myString = Console.ReadLine()
      Dim myEncodedString As String 
      ' Encode the string.
      myEncodedString = HttpUtility.HtmlEncode(myString)
      Console.WriteLine("HTML Encoded string is " + myEncodedString)
      Dim myWriter As New StringWriter()
      ' Decode the encoded string.
      HttpUtility.HtmlDecode(myEncodedString, myWriter)
      Console.Write("Decoded string of the above encoded string is " + myWriter.ToString())
   End Sub 'Main
End Class 'MyNewClass

Open in new window

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now