473,507 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to return a stream of XML rather than a dataset

JJA
I am confused about all the various methods of handling XML in ASP.Net
2.0. I want to be able to stream XML to some clientside Javascript code
(snippet below):

var urlRequest = "../GetLendersAsXML.aspx"
var request = GXmlHttp.create();
request.open("GET", urlRequest, true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
var xmlDoc = request.responseXML;

I have all the Javascript code I need but I need to have the page above
return XML.

Using SQL 2005 I have created an HTTP endpoint and exposed a stored
procedure as a webservice. I want to add a FOR XML AUTO clause in the
stored procedure to return XML as a big string (that part is easy). The
sproc currently returns a dataset and I've got this code below that
binds it to a GridView (this works but is not what I need):

Partial Class GetLendersAsDataset
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Try
Dim ws As yukon.ITMO_Lenders = New yukon.ITMO_Lenders
Dim ds As System.Data.DataSet
ws.Credentials = New System.Net.NetworkCredential("myID",
"myPass", "myDomain")
Dim oa As Object()
oa = ws.GetLenderLocations("GOLDEN EMPIRE MORTGAGE")
'hardcode example for testing
If oa(1).ToString() = "System.Data.DataSet" Then
ds = DirectCast(oa(1), System.Data.DataSet)
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
End If
Catch ex As ApplicationException
Response.Write(ex.ToString)
End Try
End Sub
End Class

So, if I change my stored procedure by adding FOR XML clause, then
ws.GetLenderLocations webmethod above will return XML. Can anybody
suggest code for my ASPX page to stream this XML so that my Javascript
at the top of the post can read it?

Dec 1 '06 #1
0 971

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9063
by: Steve Gilbey | last post by:
I have a dataset from which I need to extract certain columns, format them into xml and output to an xmldocument object. From reading various posts on similar subjects, I have come up with the...
1
5216
by: Patrik | last post by:
Hi I want to return a dataset from a webservice and exclude the schema. How can I do this? /Patrik
5
12674
by: ad | last post by:
I want to uplad a dataset to server by WebService, But the dataset is to huge (50 fields in 50000 rows) I want to compress it before upload, Now my steps are In Client 1....
5
10146
by: Rob Panosh | last post by:
Hello, I am trying to create a xmlDocument from as dataset. My code is listed below. All seems to go well until xmlDocument.Load(CType(ms, System.IO.Stream)) ... I keep getting the following...
1
6113
by: Anonieko | last post by:
Here are some of the approaches. 1. Transform DataGrid http://www.dotnetjohn.com/articles.aspx?articleid=36 3. Use the Export approach ...
4
9943
by: Fresh_Air_Rider | last post by:
Hi In the "good old" Classic ASP days, I used to stream records from a SQL Server database out to the user's browser in CSV format by using a combination of COALESCE and the ADODB.Stream object....
8
3743
by: T Driver | last post by:
Anyone have any idea how I can do the following? I have a connection to an XML file on a site I do not control, getting a string representation of the xml data that I can then feed to my...
4
3578
by: Rymfax | last post by:
Greetings, I have an app that uses HttpWebRequest to download a rather large file (100 MB). I have a while loop set up so that it reads 4096 bytes at a time from the ResponseStream() until it...
4
9369
by: Brad | last post by:
I am trying to convert an XML Stream received from a web api call into a DataSet to use in the rest of the app. The issue I am running into is that it will not convert the stream to a dataset and...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.