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?

Thanks!

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.

ZeroCul,
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! :)
Gilbert.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.