By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,609 Members | 1,565 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,609 IT Pros & Developers. It's quick & easy.

XML error: Illegal characters in path

P: n/a
Hi, I am using a web service to call an asp page on a remote server via
System.Net.WebClient . The asp page returns a xml stream persisted from a

I am having problems converting the stream into a valid xmltextreader
document. I have also converted the document to the simple format without
the DTD ( just plain xml file )
and I still get the same error:

Illegal characters in path.
Exception Details: System.ArgumentException: Illegal characters in path.

I have pasted to code below:

<WebMethod(Description:="passsing ODBC sql str and DSN paramenters. Returns
datatable")> _

Public Function TestURL(ByVal strSQL As String, ByVal DSN As String) As

Dim web As New System.Net.WebClient
Dim URL As String = "http://remote_server/query_legacy.asp"
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim param1 As String = "strSQL=" & strSQL
Dim param2 As String = "DSN=" & DSN

Dim params As String = param1 & "&" & param2

Dim bytparams As Byte() = BuildPostData(params)

Dim res As Byte() = web.UploadData(URL, "POST", bytparams)

Dim ds As New DataSet

Dim str1 As String = System.Text.Encoding.ASCII.GetString(res)

==> ERROR RIGHT HERE: Dim stream_r As New StreamReader(str1)

Dim xml_r As New System.Xml.XmlTextReader(stream_r)


Return ds.Tables(1)

End Function

Any suggestions ?

Thanks a lot in advance!

Nov 11 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.