I'm trying to compile some code that will check if a date from a datetimepicker and text from a textbox match exisisting entries in a datagridview if so throw a message window.
Example:
on my form i have dateTimePicker1 and resIndexTextBox, i have a datagridview with coloumn [1] being a stored date entry and column [8] with a stored resIndex value.
Can dateTimePicker1 check through datagridview column 1 and resIndexTextBox check through column 8 at the same time, if both match the datagrid values throw up a message box?

2 answers
Try the following code (including EDIT):
answered one year ago by:
17279
That works spot on vulpes thanks, could i adapt it to perform a function if the dates don't match?, i've tried something like the below but somethings wrong with my attempt, basiclly this is stopping a double booking, so if the dates match it would stop the user saving, but if the dates dont match perform save function.
answered one year ago by:
690
17279
I think you need to move the 'else if' and 'else' blocks outside the foreach statement. See my edit.
690
Nice one - thanks vulpes