Hey there guys, Im looking for a nifty trick in VB.NET that will help me with an error that is constantly Reoccuring.
This is some example code:
Dim array as Textbox() = {txt1, txt2, txt3}
'Array of textbox's
For loop = 0 to 3
If Array(Loop).text = Data_In_Database then
'Do something
next
Here I have a loop that will Do something if some data in my array of textbox's matches something in a database.
What I want to know is how can I place an error box if it Doesnt Match?
If I set it after the loop, it will happen even if the data does match.
If I set it as a fail condition in the IF statement, then I will get it appearing for each textbox that fails.
The only thing i can think of is the make a variable to count along with the loop and then if it fails on that count, show an error box, but that can be quite innefficient in comparison to an easier solution that i'm sure someone out there knows.
Thanks for the help guys c: