473,396 Members | 1,866 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,396 software developers and data experts.

Validate XML data before DataSet.Read - httpRequest

Hi,

I posted an issue on the .vb group that is related to the .Net
Framework 2.0.
Posting here for a larger abrangence:

i'm developing a windows application that gets data from an Mysql
database through PHP server-side scripts. I'm not totally familiar
with Requests and XML on .Net 2.0.
I'll load these sort of data - simply generated by the phps - into a
dataset and i want to validate, before, if the response from server
isn't anything other than an valid XML structure, to be able to catch
eventual server-side errors.
How this could be done? Load the data into a xml object and catch
parse errors?

Thanks for any appointments

Thiago

ref: http://groups.google.com/group/micro...88e315e1c86624
Jun 27 '08 #1
4 1988
On May 1, 1:19*pm, Thiago Macedo <thiago.ch...@gmail.comwrote:
Hi,

I posted an issue on the .vb group that is related to the .Net
Framework 2.0.
Posting here for a larger abrangence:

i'm developing a windows application that gets data from an Mysql
database through PHP server-side scripts. I'm not totally familiar
with Requests and XML on .Net 2.0.
I'll load these sort of data - simply generated by the phps - into a
dataset and i want to validate, before, if the response from server
isn't anything other than an valid XML structure, to be able to catch
eventual server-side errors.
How this could be done? Load the data into a xml object and catch
parse errors?

Thanks for any appointments

Thiago

ref:http://groups.google.com/group/micro...languages.vb/b....
Hi,

I think you can do it like that, simply try to load it in a XML and
catch any error
also you could start parsing it (in case you get no error) and catch
ahy possible error (like invalid data values) when you are creating
your dataset
Jun 27 '08 #2
If you use the DataSet's ReadXml method, you will either get a DataSet
because the XML is valid, or an exception. So all you need to do is code
defensively by catching the exception and showing an appropriate error
message to your user.
Peter
"Thiago Macedo" <th**********@gmail.comwrote in message
news:c9**********************************@8g2000hs e.googlegroups.com...
Hi,

I posted an issue on the .vb group that is related to the .Net
Framework 2.0.
Posting here for a larger abrangence:

i'm developing a windows application that gets data from an Mysql
database through PHP server-side scripts. I'm not totally familiar
with Requests and XML on .Net 2.0.
I'll load these sort of data - simply generated by the phps - into a
dataset and i want to validate, before, if the response from server
isn't anything other than an valid XML structure, to be able to catch
eventual server-side errors.
How this could be done? Load the data into a xml object and catch
parse errors?

Thanks for any appointments

Thiago

ref:
http://groups.google.com/group/micro...88e315e1c86624
Jun 27 '08 #3
On May 1, 3:09 pm, "Peter Bromberg [C# MVP]"
<pbromb...@nospammin.yahoo.comwrote:
If you use the DataSet's ReadXml method, you will either get a DataSet
because the XML is valid, or an exception. So all you need to do is code
defensively by catching the exception and showing an appropriate error
message to your user.
Peter"Thiago Macedo" <thiago.ch...@gmail.comwrote in message

news:c9**********************************@8g2000hs e.googlegroups.com...
Hi,
I posted an issue on the .vb group that is related to the .Net
Framework 2.0.
Posting here for a larger abrangence:
i'm developing a windows application that gets data from an Mysql
database through PHP server-side scripts. I'm not totally familiar
with Requests and XML on .Net 2.0.
I'll load these sort of data - simply generated by the phps - into a
dataset and i want to validate, before, if the response from server
isn't anything other than an valid XML structure, to be able to catch
eventual server-side errors.
How this could be done? Load the data into a xml object and catch
parse errors?
Thanks for any appointments
Thiago
ref:
http://groups.google.com/group/micro...languages.vb/b...
Right.
But while i'm developing in 2 ambients (server and windows client) i'm
trying to integrate the error handling. I'd like to show up, in
client, the PHP error message that would be generated by it, that in
case, would be the way to no valid XML return and ReadXML exception be
thrown.
But after ReadXml try to parse the XML Stream (and gets an exception)
i can't read its response anymore (forward-only), excepts if I run the
script again (till now is the unique way I see).

Thank you very much

Thiago
Jun 27 '08 #4
On May 1, 3:51 pm, Thiago Macedo <thiago.ch...@gmail.comwrote:
On May 1, 3:09 pm, "Peter Bromberg [C# MVP]"

<pbromb...@nospammin.yahoo.comwrote:
If you use the DataSet's ReadXml method, you will either get a DataSet
because the XML is valid, or an exception. So all you need to do is code
defensively by catching the exception and showing an appropriate error
message to your user.
Peter"Thiago Macedo" <thiago.ch...@gmail.comwrote in message
news:c9**********************************@8g2000hs e.googlegroups.com...
Hi,
I posted an issue on the .vb group that is related to the .Net
Framework 2.0.
Posting here for a larger abrangence:
i'm developing a windows application that gets data from an Mysql
database through PHP server-side scripts. I'm not totally familiar
with Requests and XML on .Net 2.0.
I'll load these sort of data - simply generated by the phps - into a
dataset and i want to validate, before, if the response from server
isn't anything other than an valid XML structure, to be able to catch
eventual server-side errors.
How this could be done? Load the data into a xml object and catch
parse errors?
Thanks for any appointments
Thiago
ref:
>http://groups.google.com/group/micro...languages.vb/b...

Right.
But while i'm developing in 2 ambients (server and windows client) i'm
trying to integrate the error handling. I'd like to show up, in
client, the PHP error message that would be generated by it, that in
case, would be the way to no valid XML return and ReadXML exception be
thrown.
But after ReadXml try to parse the XML Stream (and gets an exception)
i can't read its response anymore (forward-only), excepts if I run the
script again (till now is the unique way I see).

Thank you very much

Thiago
Please, let me know if i'm completly wrong or don't make my self
clear.

Thiago
Jun 27 '08 #5

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

Similar topics

3
by: NextOne | last post by:
Hi ! Is it possible to send an AJAX XMLHttpRequest using prototype.js API for a multipart/form-data ? I already done parsing form parameters and sending GET/POST request, but does this work...
5
by: Tammy | last post by:
Hi, I have an aspx app which needs to post data to a form and read the response. I am confused on whether I should be using the get_url using "POST" method or the post_url using "GET" method. ...
1
by: Smokey Grindle | last post by:
to start off with the page the free text box (version 3) is on has validateRequest="false" in the page directive already... but even with that when I am in the page and then click on a link to...
2
by: adwooley2 | last post by:
Hello. Have been losing plenty of hair over problem whereby I can't make it off the login page. Trying to pass login info to a login page and then move on to another page within the site so that...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.