• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 759
  • Last Modified:

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

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
stev0931
Asked:
stev0931
  • 3
  • 3
2 Solutions
 
RejojohnyCommented:
response.Write(dataset1.getxml()) should work ..

Rejo
0
 
stev0931Author Commented:
Great!  By any chance, do you know how to do this for an arbitrary object type?
0
 
RejojohnyCommented:
what is an arbitrary object type??
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
stev0931Author Commented:
For example,

class DataType

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

end class
0
 
RejojohnyCommented:
i do not think there is any generic way of converting a class to xml ..
0
 
stev0931Author Commented:
Thanks!  I've got a solution working now...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now