Hello,
How do I retrieve SQL Data into an XML Document? I have the following
code, which will retrieve SQL data and write it to the screen via the
Response Object, but I'd like to be able to read it as XML Data, and
use XSL and XSLT to display the data.
Any suggestions? Code Snippets MORE than appreciated... :)
=============== =============== =============== =============== =====
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles
Button1.Click
Dim objConn As New OleDbConnection ( _
"Provider=MSDAO RA.1;User
ID=abc;DataSour ce=sdqa.ourcomp any.com;Passwor d=pwabc")
Dim objCmd As OleDbCommand
Dim objRdr As OleDbDataReader
Dim doc As XmlDocument
Dim trans As XslTransform
objConn.Open()
objCmd = New OleDbCommand("S elect * from z_test", objConn)
OleDbConnection 1.Open()
objRdr = objCmd.ExecuteR eader
While objRdr.Read
Response.Write( objRdr.Item("fi rstname") & _
"," & objRdr.Item("la stname") & _
"," & objRdr.Item("ci ty") & _
"," & objRdr.Item("st ate") & _
"<br />")
End While
objRdr.Close()
'doc = New XmlDocument
'doc.Load(Serve r.MapPath("chap ter8.xml"))
'trans = New XslTransform
'trans.Load(Ser ver.MapPath("ch apter8.xsl"))
'Xml1.Document = doc
'Xml1.Transform = trans
End Sub