Link to home
Start Free TrialLog in
Avatar of jamppi
jamppiFlag for Sweden

asked on

sqlserver query to output xml into asp.net page

Hi!

i Have simple data connection like this

Dim GetDataQry As String = "SELECT * from facilities where ItemID=@ItemId FOR XML PATH"
            Dim cmd As New SqlClient.SqlCommand(GetDataQry, conn)

with a SqlDataReader.

but it outputs only text. not xml as the query requests.
how do i get it to output xml into a asp.net page.
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jamppi

ASKER

you got me on right track..  i had to change the document properties to
Response.ContentType = "text/xml"

then i got it right!

/J