I am trying to build an SQL query to compare date in my txtDate box to one in access database for my database search-page. I'm clueless as to which is the best method to do this. Obviously just comparing the textbox value doesn't work. This is my current if-function to check it:
else if((DropDownList1.SelectedValue == "") && (txtDate.Text != ""))
{
strSQL = "SELECT * FROM [" + DropDownList2.SelectedValue + "] WHERE DATE_START = " + txtDate.Text;
}
And is there any better way to build different kind of searches other than lots of if and elseif functions in a row, like i have done?