Hello DelTreme,
Tried your suggestion but that doesn't work.
Main Topics
Browse All TopicsHi,
On my web page, a button generates an XML file (on click) whose data comes from SQL server. This XML file output is to be used as an import file to a legacy system. XML file is generated without dramas but the problem is that the tag <?xml version="1.0" encoding="ISO-8859-1" ?> is not included on the top of the XMl file, this tag is needed by the recievning application.
I'm practically out of clue as to where or what i missed. Can anyone help me understand and suggest a fix on my problem?
Here is the event on my webpage. And on the snippet is my XSL template...
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Using conn As New Data.SqlClient.SqlConnecti
Dim cmd As New Data.SqlClient.SqlCommand(
cmd.CommandType = Data.CommandType.StoredPro
conn.Open()
'Add parameters (NationalUPN) selected from form for WHERE clause
cmd.Parameters.Add("@Natio
cmd.Parameters("@NationalU
'Add parameters (AcademicYear) selected from form for WHERE clause
cmd.Parameters.Add("@Acade
cmd.Parameters("@AcademicY
'Add parameters (SchoolDestination) selected from form for WHERE clause
cmd.Parameters.Add("@Schoo
cmd.Parameters("@SchoolDes
Dim da As New Data.SqlClient.SqlDataAdap
Dim ds As New Data.DataSet
da.Fill(ds)
Dim nowString As String = Now.ToString("dd-MM-yyyy hh.mm.ss")
Dim fileName As String = "D:\TEMP\000LLL_CTF_SMI_" & nowString & ".xml"
'Dim fileName As String = "C:\Documents and Settings\jackson.suanque.N
ds.WriteXml(fileName)
Dim doc As System.Xml.XmlDataDocument
Dim transform As New System.Xml.Xsl.XslCompiled
transform.Load("D:\Inetpub
'transform.Load(Server.Map
Dim writer As System.Xml.XmlTextWriter = New System.Xml.XmlTextWriter(f
writer.Formatting = System.Xml.Formatting.Inde
writer.Indentation = 2
transform.Transform(doc, Nothing, writer)
End Using
End Sub
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: DelTremePosted on 2009-07-16 at 07:46:43ID: 24869655
In this line:
ileName, System.Text.Encoding.UTF8)
ileName, System.Text.Encoding.GetEn coding(125 2))
Dim writer As System.Xml.XmlTextWriter = New System.Xml.XmlTextWriter(f
You create a TextWriter using the UTF8 encoding. Try this one instead:
Dim writer As System.Xml.XmlTextWriter = New System.Xml.XmlTextWriter(f
That should at least output the data in Latin-1 (ISO-8859-1).