Solved

Write XML to the output stream from an ASP.NET web site

Posted on 2006-06-22
6
750 Views
Last Modified: 2008-02-01
I have an ASP.NET web site using VB.NET and I would like to dump XML to the output stream.  For example,

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    dim dataset1 as New Data.DataSet=getbudgets()
    response.Write(dataset1 as xml)           'this is the part that doesn't work
End Sub





I have to think this can be done since an ASP.NET XML web service consists of functions like

<WebMethod()> _
    Public Function getSystemLog(ByVal FromDate As Date, ByVal ToDate As Date) As SystemLogEntryType()
        Dim retval(1) As SystemLogEntryType

and they spit out XML
0
Comment
Question by:stev0931
  • 3
  • 3
6 Comments
 
LVL 26

Accepted Solution

by:
Rejojohny earned 500 total points
ID: 16965180
response.Write(dataset1.getxml()) should work ..

Rejo
0
 

Author Comment

by:stev0931
ID: 16966021
Great!  By any chance, do you know how to do this for an arbitrary object type?
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 16970561
what is an arbitrary object type??
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:stev0931
ID: 16970876
For example,

class DataType

public ID as long
public Name as string
public Description as string
...

end class
0
 
LVL 26

Assisted Solution

by:Rejojohny
Rejojohny earned 500 total points
ID: 16971205
i do not think there is any generic way of converting a class to xml ..
0
 

Author Comment

by:stev0931
ID: 17024242
Thanks!  I've got a solution working now...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

861 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