473,499 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dataset to client as xml

Hello,

I have an aspx page that reads info from a database and puts in in a
dataset. Then an XML-file is created by a myDataset.WriteXml("myInfo.xml")
statement.

After that the XML-file must be read by an aspx-page that resides on
anaother server. I do that as follows
Dim reader as XmlTextReader = New
XmlTextReader("http://companywebsite.nl/myInfo.xml").

Then I put the info in a dataset:
Dim ds as DataSet = New DataSet()
ds.ReadXml(reader)

And then the processing continues on my local webserver.

I would like to make a page that don't writes the xml to a file but that
sends it directly to the calling client. I fact I want to call an
aspx-pages that creates the xml and sends it direct to the calling page,
like
Dim reader as XmlTextReader = New
XmlTextReader("http://companywebsite.nl/GiveMeMyInfo.aspx")

The trick is i call an aspx-page but want xml back, can anybody tell me how
to do that?

John
Nov 18 '05 #1
1 982
Answered in the other message...

<%@ Page Language="vb" AutoEventWireup="true"%>
<script language=vb runat=server>
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
' By Ken Cox for John Boers
' July 18/2004
Dim myDataSet As New system.data.DataSet
myDataSet.Tables.Add(CreateDataSource())
Dim xmlDoc As System.Xml.XmlDataDocument = _
New System.Xml.XmlDataDocument(myDataSet)
Response.Clear()
Response.ClearHeaders()
Response.ContentType = "text/xml"
Response.Write(xmlDoc.InnerXml)
End Sub
Function CreateDataSource() As _
system.data.DataTable
Dim dt As New system.data.DataTable
Dim dr As system.data.DataRow
dt.Columns.Add(New system.data.DataColumn _
("IntegerValue", GetType(Int32)))
dt.Columns.Add(New system.data.DataColumn _
("StringValue", GetType(String)))
dt.Columns.Add(New system.data.DataColumn _
("CurrencyValue", GetType(Double)))
dt.Columns.Add(New system.data.DataColumn _
("Boolean", GetType(Boolean)))
Dim i As Integer
For i = 0 To 8
dr = dt.NewRow()
dr(0) = i
dr(1) = "Item " + i.ToString()
dr(2) = 1.23 * (i + 1)
dr(3) = (i = 4)
dt.Rows.Add(dr)
Next i
Return dt
End Function 'CreateDataSource
</script>
"John Boers" <jj******@hccnet.nl> wrote in message
news:12****************************@40tude.net...
Hello,

I have an aspx page that reads info from a database and puts in in a
dataset. Then an XML-file is created by a myDataset.WriteXml("myInfo.xml")
statement.

After that the XML-file must be read by an aspx-page that resides on
anaother server. I do that as follows
Dim reader as XmlTextReader = New
XmlTextReader("http://companywebsite.nl/myInfo.xml").

Then I put the info in a dataset:
Dim ds as DataSet = New DataSet()
ds.ReadXml(reader)

And then the processing continues on my local webserver.

I would like to make a page that don't writes the xml to a file but that
sends it directly to the calling client. I fact I want to call an
aspx-pages that creates the xml and sends it direct to the calling page,
like
Dim reader as XmlTextReader = New
XmlTextReader("http://companywebsite.nl/GiveMeMyInfo.aspx")

The trick is i call an aspx-page but want xml back, can anybody tell me
how
to do that?

John


Nov 18 '05 #2

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

Similar topics

8
2370
by: Programatix | last post by:
Hi, I'm working on a project which includes XML WebServices and Windows Form application. The Windows Form application will call the XML WebServices to retrieve data from database. The data...
7
354
by: Richard Myers | last post by:
Hello. I am getting an InvalidCastException which has revealed yet more of my ignorance. I cant believe i dont already know this and haven't encountered it before until now. I am consuming a...
1
4290
by: Andy | last post by:
Hello, I have a WebService that sends a client a DataSet as XML (I use a DataSet.GetXml to get the XML). The DataSet is filled by a DataAdapter in the WebService. The client coverts the XML Back...
10
1505
by: localhost | last post by:
I have a static, thread-safe class with a DataSet as a property. When the class is instanced into an object, some callers add rows to a DataTable in the DataSet. Other callers read the DataSet. ...
2
1620
by: Martin | last post by:
Hi! I'm new to ASP.NET WebApplications and wonder whether I've missed something out when programming it. I'm grateful for any hints to this problem! Thanks very much for your efforts! Martin...
22
25544
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
2
2808
by: Anthony Malt | last post by:
Hi, my server has a database table. I read this table on the server into a dataset and my client retrieves it through a webservice. No changes on the client and server happen. What's the best...
4
2218
by: Al | last post by:
I have this scenario: 1. XML file with schema and data is created from SQL Server tables. XML file contains 6 tables, some of them have rows, some of them are empty. 2. XML file is given to the...
3
1563
by: Jon Vaughan | last post by:
I have a client side dataset that is made up from a stored proc, I also have a web service that returns a dataset from this stored proc. But when I call the web service and try and store them in an...
15
13477
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
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
4919
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
3099
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
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.