M
Mike P
I am entering two dates into textboxes and using them as control
parameters in an SQL DataSource which is being used to populate a
gridview. I am using a custom validator to check if the data entered
into the text boxes are valid dates, but even when my code captures that
they are not valid dates it seems like it still tries to populate the
gridview and in doing so gives me the error 'Conversion failed when
converting datetime from character string'.
How can I prevent these parameters being passed to the gridview if they
are invalid?
parameters in an SQL DataSource which is being used to populate a
gridview. I am using a custom validator to check if the data entered
into the text boxes are valid dates, but even when my code captures that
they are not valid dates it seems like it still tries to populate the
gridview and in doing so gives me the error 'Conversion failed when
converting datetime from character string'.
How can I prevent these parameters being passed to the gridview if they
are invalid?