www.webdeveloper.com
Results 1 to 4 of 4

Thread: ASP vs. ASP.NET

  1. #1
    Join Date
    May 2003
    Posts
    599

    ASP vs. ASP.NET

    I basically want to pull raw data from a SQL Server 2000 DB table into an XML page (looped data), and display this data in an ASP.NET page. I've looked high and low, but can't find info on how to do this. The closest thing that I've found is from W3Schools, but it uses ASP instead of ASP.NET. This is the URL for that page: http://www.w3schools.com/xml/xml_server.asp
    ...and this is the code that they reference:
    Code:
    <%
    response.ContentType = "text/xml"
    
    set conn=Server.CreateObject("ADODB.Connection") 
    conn.provider="Microsoft.Jet.OLEDB.4.0;"
    conn.open server.mappath("/ado/database.mdb")
    sql="select fname,lname from tblGuestBook"
    set rs=Conn.Execute(sql)rs.MoveFirst()response.write("<?xml version='1.0' encoding='ISO-8859-1'?>")
    response.write("<guestbook>")
    while (not rs.EOF)
      response.write("<guest>")
      response.write("<fname>" & rs("fname") & "</fname>")
      response.write("<lname>" & rs("lname") & "</lname>")
      response.write("</guest>")
      rs.MoveNext()
    wendrs.close()
    conn.close()
    response.write("</guestbook>")
    %>
    So is there either a way to do this in ASP.NET easily, or a way to do the same thing in an XML page? Thanks for any help.
    KWilliams
    -----------------------
    It's the end of the world as we know it...and I feel fine

  2. #2
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222

  3. #3
    Join Date
    May 2003
    Posts
    599
    Great PeOfEo,

    Thanks for the great reference articles. I'm in the process of reading through them, and hopefully they'll help me out with understanding the relationship between ASP.NET and XML better.
    KWilliams
    -----------------------
    It's the end of the world as we know it...and I feel fine

  4. #4
    Join Date
    Nov 2003
    Posts
    655
    Look up "FOR Clause" in the index of SQL Server Books Online and look at the XML option. Also, look up "Executing Template Files Using HTTP", as, depending on your needs, you may be able to entirely avoid involving ASP.NET in the process.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles