473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Return XML from SQL Server

By using Virtual Directory I can return XML Data to my browser by either
using Transact SQL directly in my URL as below:
http://localhost/MyVirualDirector?sql=SELECT+ CustomerID+ CompanyName +FROM+
Customers +FOR+XML+AUTO,+ELEMENTS&root= MyList

Or by include my query within an XML and call it trough my Virual Director
as:

http://localhost/TIR/ MyList.xml

MyList.xml typed out:

<?xml version="1.0" encoding="UTF-8"?>
<MyList xmlns:sql='urn:schemas-microsoft-com:xml-sql'>
<sql:query>
SELECT CustomerID, CompanyName
Customers
XML AUTO, ELEMENTS
</sql:query>
</MyList>

I am wondering if it is possible to get a call (e.g.
http://localhost/MyList.aspx) to an ASP.NET page to return XML to my browser
as above. And if it is possible can I as well pass some parameters to be
variables in the Transact SQL within the .aspx

The method I am using to day needs some action from my Internet Service
Provider like applying the virtual directory and mapping to my template XML
file. I would like to include my connection settings within my .aspx so that
I have full control over the application.

Anyone having a little example on how to do this

TIRislaa
Nov 19 '05 #1
1 3202
Hi TIRislaa:

You can always send XML back in the response stream directly - set the
Response.ContentType = "text/xml". There is an example here
(http://support.microsoft.com/default...;en-us;330597),
although it concentrates on date time formatting it does what you are
looking for with XML.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 22 Apr 2005 08:57:07 +0200, "Tor Inge Rislaa"
<no*************@rislaa.no> wrote:
By using Virtual Directory I can return XML Data to my browser by either
using Transact SQL directly in my URL as below:
http://localhost/MyVirualDirector?sql=SELECT+ CustomerID+ CompanyName +FROM+
Customers +FOR+XML+AUTO,+ELEMENTS&root= MyList

Or by include my query within an XML and call it trough my Virual Director
as:

http://localhost/TIR/ MyList.xml

MyList.xml typed out:

<?xml version="1.0" encoding="UTF-8"?>
<MyList xmlns:sql='urn:schemas-microsoft-com:xml-sql'>
<sql:query>
SELECT CustomerID, CompanyName
Customers
XML AUTO, ELEMENTS
</sql:query>
</MyList>

I am wondering if it is possible to get a call (e.g.
http://localhost/MyList.aspx) to an ASP.NET page to return XML to my browser
as above. And if it is possible can I as well pass some parameters to be
variables in the Transact SQL within the .aspx

The method I am using to day needs some action from my Internet Service
Provider like applying the virtual directory and mapping to my template XML
file. I would like to include my connection settings within my .aspx so that
I have full control over the application.

Anyone having a little example on how to do this

TIRislaa


Nov 19 '05 #2

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

Similar topics

10
by: Don | last post by:
I want the server-side php script to return a browser page that is essentially a copy of the original client page that contained the <form> which referenced the php script in the first place....
2
by: burdeen | last post by:
I've been trying to return an array with PHP5 soap. Is this not supported? or am i doing it wrong? Seems to return on the last element in the array. In my WSDL i've defined my return type as a...
0
by: Juan Carlos CORUÑA | last post by:
Hello all, I have developed an automation server using Mark's win32 extensions and I must return a IStream COM object from one method of the automation server. Here is an extract of my code:...
3
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
6
by: Tim Roberts | last post by:
I've been doing COM a long time, but I've just come across a behavior with late binding that surprises me. VB and VBS are not my normal milieux, so I'm hoping someone can point me to a document...
18
by: Pedro Pinto | last post by:
Hi there once more........ Instead of showing all the code my problem is simple. I've tried to create this function: char temp(char *string){ alterString(string); return string;
5
by: Mike King | last post by:
I think I'm dealing with a bug in a library or some weird problem. The following code compiles and works as I'd expect on Linux and cygwin, but on the machine that matters (HP PA64, HPUX 11.11) it...
13
by: Andrew | last post by:
Hi I was wondering if there is anyway with XML RPC to send a string of text from the server to the client with out calling return thus breaking my loop for example def somefunc(): for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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,...

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.