Also.
What you have is a character array. What you're comparing to is integers. 1 and 2. They are characters as well, just represented in ascii value. So by the time you're finding the 'D', the other two elements I'm sure aren't ascii 1 and 2 which aren't standard characters.
You want this:
Code:
while (!(Barcode[date0] == '1' && Barcode[date1] == '2' && Barcode[date2] == 'D'))
{
date0++; date1++; date2++;
}
//or if you wish: while (Barcode[date0] != '1' || Barcode[date1] != '2' || Barcode[date2] != 'D')