hi friends,
In if condition,
it checks only else part in runtime,
CommandText = "select * from empOrder By calldate desc limit 20 WHERE calldate > '" + Label1.Text + "' Order By calldate desc limit 20";
please correct this code.
OdbcConnection myConnection = new OdbcConnection(ConnectionString);
string CommandText = string.Empty;
if(Label1.Text == "" || Label1.Text == null)
{
CommandText = "select * from emp Order By calldate desc limit 20";
}
else
{
CommandText = "select * from emp Order By calldate desc limit 20 WHERE calldate > '" + Label1.Text + "' Order By calldate desc limit 20";
}
OdbcCommand myCommand = new OdbcCommand(CommandText, myConnection);
myConnection.Open();
GridView1.DataSource = myCommand.ExecuteReader();
GridView1.DataBind();
myConnection.Close();
thanks.