Click here to Skip to main content
16,005,826 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

What is the accepted way of generating/storing/accessing a large list of user errors when programming in VB.NET?

I have a many errors that I would like to report if they occur. I have the error headings, and descriptions in a list that correspond to a hex code.

I could build two string arrays, but I figured that's not the appropriate method of doing something like this and then there would have to be many blank entries where the hex code doesn't correspond to a valid error code. I could also do a very large case statement, but again, I'm not sure that's the appropriate method of doing this. I could build a table in runtime and do a search for the hex code and then display the corresponding columns.

I couldn't figure out what is the accepted procedure for doing this. Can someone please tell me what the correct approach is to error reporting in VB.NET, with regard to storing the error information.

Thanks,

Marco
Posted

1 solution

If you are reporting errors to the user, then time is not a major issue: so you do what is "cleanest".
If you are using a hex code to be the "master" and looking for an appropriate header and description to present to the user, then I'd probably use one (or two) database tables as they are simple to access and simple to change.
If the headings are shared, then I'd use two tables: one for headings and one for hex-to-description translation that includes a foreign key to the heading table. And then use a simple JOIN to get both text strings from the hex value.
 
Share this answer
 
Comments
[no name] 3-Aug-14 6:54am    
Hi OriginalGriff,

Thanks, I was wondering about that. What simple database format would you recommend I use, I mean what is the industry standard for this?

Thanks,

Marco
OriginalGriff 3-Aug-14 7:20am    
If is a website - and VB.NET implies it is - it will depend on what you web host provides.
Most provide Sql Server or MySql, some also Access.

If it isn't, it depends on what else you are using. What does your app have access to or use for other things? Is multiuser needed? lots of variables!
[no name] 14-Aug-14 1:24am    
Oh yeah, sorry I guess the question was a bit open ended there.

For the most part I'm doing single user, windows forms applications. I'm just curious what the typical approach for storing an entire application's error information would be.
OriginalGriff 14-Aug-14 3:10am    
Depends on the programmer, and how many errors we are talking about: Many systems don't have a "central store" of error info, but just add a new message / code when they report it. Works well for small error numbers, but it can be a PITA if you are trying to collate them for the user documentation or for multilingual translation.

There is no "one way" to do this - much like the rest of computing! :laugh:
[no name] 14-Aug-14 4:09am    
LOL, that's true! I'll have a look into PITA, I'm not familiar with that. Now that you mention multilingual support, it is actually something I want to look into in the near future.

Thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900