Hi, I'm developing an application that uses an XML sheet with ID's. There are over 3000 ID's and when I start the application, if some ID's aren't in the file that were there before.. I have error checking that makes a MessageBox popup that says "ID: 12345 is not longer in DB", except if there are many it is very annoying for the user to click OK, or press the Enter key many times.
How can I make somekind of check that would not display all those messages, but rather just ONE message. (The message does not have to show all of the ID's, just a general message of text indicating there was an error finding many ID's)
Thanks in advance,
John
Loading
John SimoesPosted Apr 23, 2008, 9:52 PM
Thanks Scott!
Then logging the error ID's would be as easy as exporting them into a text file using a FileI/O object?
Scott LyslePosted Apr 23, 2008, 9:48 PM
Just dump all of the errors into a stringbuilder and when you have the whole group, either dump the list out into a messagebox or a custom dialog.
StringBuilder sb = new StringBuilder();
// whatever test is collecting the failed id's
for (int i = 0; i < 20; i++)
{
sb.Append("Error Message " + i + Environment.NewLine);
}
MessageBox.Show(sb.ToString(), "Error");