How to display a GridView from database matching either one of the two conditions. I have 3 input TextBoxes. First condition is to display based on the 1st TextBox value and the second condition is to display based on all the three TextBoxes. My conditions are:
1.select * from CG_TPO_GOV_EventDetails where EventName='Event Name 1'
2.select * from CG_TPO_GOV_EventDetails where EventName='Event Name 1' and StartDate='2011-11-11' and EndDate='2012-11-11'
You need to Write SQL Query (i prefer stored procedure ), then Handle the Situation like this, and don’t use
SELECT * from, use only whatever column you needed,for checking between date, you can refer this link , which tells very clearly Selecting Data between Dates
then You use this result to bind your textbox, with dataset