Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

the getxml method used to get the xml d

Posted on 2014-07-25
1
Medium Priority
?
335 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 2000 total points
ID: 40221347
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

783 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