473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

datasets & xmlhttp?

Hello. I'm using xmlhttp in a windows application to return xml data.
The xml data is returned successfully, but I get errors when I try
loading the xmlhttp response object to a dataset. I can write the xml
to a file & read that in to a dataset, but what fun is that?
---------------
code:
xmlhttp = New MSXML2.XMLHTTP
xmlhttp.open("POST", strUrl, False)
xmlhttp.setRequestHeader("Content-Type", "text/xml")
xmlhttp.Send("...request ...")
Dim ds1 As New DataSet
ds.ReadXml(xmlhttp.responsexml.xml, XmlReadMode.Fragment)
---------------
the last line above, and any variations I've tried(xmlreadmode.auto,
etc.), all result in varying errors. This variation gives: "Illegal
characters in path."

Any insight appreciated.

Nov 21 '05 #1
4 1779

<sf****@hotmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Hello. I'm using xmlhttp in a windows application to return xml data.
The xml data is returned successfully, but I get errors when I try
loading the xmlhttp response object to a dataset. I can write the xml
to a file & read that in to a dataset, but what fun is that?
---------------
code:
xmlhttp = New MSXML2.XMLHTTP
xmlhttp.open("POST", strUrl, False)
xmlhttp.setRequestHeader("Content-Type", "text/xml")
xmlhttp.Send("...request ...")
Dim ds1 As New DataSet
ds.ReadXml(xmlhttp.responsexml.xml, XmlReadMode.Fragment)
---------------
the last line above, and any variations I've tried(xmlreadmode.auto,
etc.), all result in varying errors. This variation gives: "Illegal
characters in path."

Any insight appreciated.


Why are you using (old) MSXML2.XMLHTTP instead of (new)
System.Net.WebClient?

David
Nov 21 '05 #2
Hi,

In addition to David.

A dataset in XML is a file using XML. Not every XML file is a dataset.

I hope this helps,

Cor

<sf****@hotmail.com> schreef in bericht
news:11*********************@g47g2000cwa.googlegro ups.com...
Hello. I'm using xmlhttp in a windows application to return xml data.
The xml data is returned successfully, but I get errors when I try
loading the xmlhttp response object to a dataset. I can write the xml
to a file & read that in to a dataset, but what fun is that?
---------------
code:
xmlhttp = New MSXML2.XMLHTTP
xmlhttp.open("POST", strUrl, False)
xmlhttp.setRequestHeader("Content-Type", "text/xml")
xmlhttp.Send("...request ...")
Dim ds1 As New DataSet
ds.ReadXml(xmlhttp.responsexml.xml, XmlReadMode.Fragment)
---------------
the last line above, and any variations I've tried(xmlreadmode.auto,
etc.), all result in varying errors. This variation gives: "Illegal
characters in path."

Any insight appreciated.

Nov 21 '05 #3
Hello. Thanks for the tips, but I'm not sure I'm any closer. I
changed the code to use the system.net.webclient, but the problem is
still in trying to load the response object into a dataset. Cor, I'm
not sure I fully understand your comment "not every xml file is a
dataset". Shouldn't I be able to make a dataset out of any valid xml?
David, I was using xmlhttp because I'm adapting this from an old asp
page, and that's what it used.

Here's the modified code I'm using.
-----------------
Dim objW3client As New System.Net.WebClient
objW3client.Headers.Set("Content-Type", "text/xml")
Dim bytArguments As Byte() =
System.Text.Encoding.ASCII.GetBytes(strMacro)
Try
Dim bytRetData As Byte() = objW3client.UploadData(strURL,
"POST", bytArguments)
Dim objInxText As String = ""
objInxText =
System.Text.Encoding.ASCII.GetString(bytRetData)
Dim ds As New DataSet
ds.ReadXml(objInxText)
-----------------
It's still failing in the same place, in the same way. Message "The
path is too long after being fully qualified. Make sure path is less
than 260 characters."

Nov 21 '05 #4
Slug,
Shouldn't I be able to make a dataset out of any valid xml?


A normal dataset uses only elements. It has by instance no attributes.
Although that it in a lot of cases a dataset with attributes can be used to
read. (It converts than to a related XSD). However I did not really
investigate the last part when it does and when not.

I hope this gives an idea

Cor
Nov 21 '05 #5

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

Similar topics

2
by: Brian Staff | last post by:
I was recently on a OO Design course<g> and as a result I've decided to "Tier" my ASP classic pages for maintainability. Browser <----> PT <---> BT <---> DT PT == Presentation Tier BT ==...
9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
5
by: Matt Kruse | last post by:
I'd like to test for Opera8.00's missing setRequestHeader method before actually instantiating the object. For example, this works in firefox: if (XMLHttpRequest.prototype.getRequestHeader) { ......
2
by: samir.kuthiala | last post by:
I do some requests in the background on a page using the XMLHttpRequest object. My site uses NTLM Authentication. However if the user is not logged in, it throws up an ugly dialog box. Is there...
3
by: Ivan P | last post by:
Hello! I have a index.php that on one click calls via AJAX a file.php. index.php looks like this: <html > <head> <script language="javascript" type="text/javascript" >
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
by: empiresolutions | last post by:
I'm using the following AJAX code to send GET vars to my processing PHP file. This works great as is except that it will not accept a *&* (AND symbol) in the text input. It trys to pass what is after...
1
by: msg2ajay | last post by:
hello, i am very new to Ajax i have tried an example but it showing some error can anybady tell me where i am doing mistake... my coding is as follows ajax.html: ----------- ...
1
by: fidgen | last post by:
Hiya, I'm trying to get a AJAX driven update to my list of news articles, so when users click the title of the news article, it pops up the article content in a thickbox overlay. Retrieving...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...

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.