I'm using DataSet ReadXML() method to load XML files of records different tables, and all are working fine. But, I would like to have the exceptional handling that in case there're records in XML files got problem, e.g. invalid data format or exceed column width and etc, it will skip those records and continue loading remaining XML records into DataSet.

Any ideas of doing so?


6 Years
Discussion Span
Last Post by fuerer_g

I just found this myself. But if you are looping through each record and that particular record happens to have an issue or error, jut put this right above your loop.

On Error Resume Next

I am assuming you are writing this on vba.


If you are using VB.net, don't use VisualBasic stuff!
You can even remove the VisualBasic reference in the project's properties. I'd recommend doing so.

For your problem use TRY CATCH. Just don't put anything in CATCH, or maybe put something there, so you know which record gave you a problem.

Error handling in VB.net

Good luck! :)

Edited by fuerer_g: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.