Less than or Equal Date should not allow to enter
Using C# & Mysql
When i get the input date in the textbox it should compare with date from table, if it is equal it should throw error message, it should allow only the greater than date
For Example
Table1
ID Date
001 2010-08-05
002 2010-08-02
....
When i enter the date in the textbox like - 2010-08-04, it should compare with Date in the table1, if it is equal or less than max(date) from table1 then it should throw a error message, otherwise it should allow to insert a date.
Am new to mysql & c#, How to do this in c# & Mysql.
Need some code he开发者_JAVA百科lp.
I would first run a Query and fetch the max date to my front end application... Then depending on whether the application is a web application or windows application, I will use this value in Compare Validator (ASP.NET) or Textbox_Validating event to compare the values...
In case you are not familiar as to how to use Compare Validator or the Validating event, let me know, I can post some links here.
In case you want to put this restriction in your Table itself, you may need to use constraints / triggers... I dont know MySql much to help you here.
精彩评论