Hi I have the following coding whereby I am trying to show Properties that have their price within the from and to drop down menus. However it only works well when the from price is set to 0. when I do price from 1000 to 800000, properties within that range are not shown.
SqlConnection con = new SqlConnection(connString);
con.Open();
string sql = "SELECT RefNo, Price, Location, Type, Image_Path1 FROM Properties WHERE Basis = '" + basis.SelectedItem + "'and Location = '" + location.SelectedItem + "' and Type = '" + type.SelectedItem + "' and Price > '" + from.SelectedItem + "' and Price < '" + to.SelectedItem + "' ";
SqlCommand cmd = new SqlCommand(sql, con);
try
{
datalist1.DataSource = cmd.ExecuteReader();
datalist1.DataBind();
cmd.Connection.Dispose();
con.Close();
}