473,497 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to generate dynamic XML from aspx page

Dear Friends,
I was using the below code in ASP to dynamically generate XML from a SQL Query
Does anyone knows how can I migrate this code to VB and ASPX?

Regards
Robson Machado

Response.ContentType = "text/xml"
Response.Write "<?xml version='1.0' ?>"
dim RS, CN
set CN = server.CreateObject("adodb.connection")
set RS = server.CreateObject("adodb.recordset")
CN.ConnectionString = strConnect
CN.Open
RS.Open SQLStmt,cn
Response.Write "<ROOT>"
Response.Write RS2XML(RS,"RESULT")
Response.Write "</ROOT>"
CN.close
set rs = nothing
set cn = nothing
function RS2XML(rs, ChildNode)
dim Field
if rs is nothing then exit function
ChildNode = ucase(ChildNode)
if rs.eof then
RS2XML = ""
exit function
end if
do until rs.eof
if ChildNode <> "" then RS2XML = RS2XML & "<" & ChildNode & ">"
for each field in rs.fields
RS2XML = RS2XML & " <" & ucase(field.name) & ">" &
server.HTMLEncode(NotNull(field.value)) & "</" & ucase(field.name) & ">"

next
if ChildNode <> "" then RS2XML = RS2XML & "</" & ChildNode & ">"
rs.movenext
loop
end function
Function NotNull(vOrig)
If(IsNull(vOrig)) then
NotNull = ""
else
NotNull = vOrig
end if
End Function
Nov 18 '05 #1
1 1543
"=?Utf-8?B?Um9ic29uIENhcnZhbGhvIE1hY2hhZG8=?="
<Ro*******************@discussions.microsoft.com > wrote in news:FCE37981-
31*************************@microsoft.com:
Does anyone knows how can I migrate this code to VB and ASPX?


Look at System.XML.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #2

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

Similar topics

1
6612
by: Robson Carvalho Machado | last post by:
Dear Friends, I was using the below code in ASP to dynamically generate XML from a SQL Query Does anyone knows how can I migrate this code to VB and ASPX? Regards Robson Machado ...
0
2116
by: Martin | last post by:
Hi. I had a very frustrating afternoon and evening but I have got it all under control now so all of a sudden I am in a good mood. I want to share some insights on output caching with you lot. ...
10
3203
by: moondaddy | last post by:
I'm writing an ecommerce app in asp.net/vb.net and need to make the pages searchable and crawlable by spiders, particularly Google's. As far as I know, if my pages's contents are mostly populated...
2
3331
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating...
0
1093
by: Plat | last post by:
Okay, you'll probably think me crazy for asking this. And I am, but also curious; so please humor me. :) I'm wondering if there's a way to - using dynamic (server-side) compilation - include a...
2
3813
by: Developer_Software | last post by:
Thanks in advance to anyone who can help :) I've got a placeholder control WITHIN A USER CONTROL that has its contents dynamically added and removed at runtime by a regular .aspx page. At...
3
13723
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
2
1534
by: Adnan Al-Ghourabi | last post by:
Hi, We have a need to create pages on the fly for ASP.NET applications based on some string that the Url ends with. For example: http://www.domain.com/SomePath/aabbccdd. "aabbccdd" does not...
4
17384
by: Mike Logan | last post by:
I would like to dynamically create a Visio diagram from .Net. I tried looking at the Visio SDK, but the samples are extremely convoluted for me to understand. Does someone have an example of...
5
3139
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But...
0
6993
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
7197
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...
1
6881
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
7375
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...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4899
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
4584
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
3088
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...
1
650
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.