请问用下面的代码在datagridview中为什么显示不了数据?
doublemax_area=Convert.ToDouble(this.textBox5.Text)+Convert.ToDouble(this.textBox5.Te...
double max_area = Convert.ToDouble(this.textBox5.Text) + Convert.ToDouble(this.textBox5.Text) * 0.1;
double min_area = Convert.ToDouble(this.textBox5.Text) - Convert.ToDouble(this.textBox5.Text) * 0.1;
double max_money = Convert.ToDouble(this.textBox6.Text) + Convert.ToDouble(this.textBox6.Text) * 0.1;
double min_money = Convert.ToDouble(this.textBox6.Text) - Convert.ToDouble(this.textBox6.Text) * 0.1;
string sqlStr = "select [* from Houses where (Hmoney between '" + min_money + "' and '" + max_money + "') and (Harea between '" + min_area + "' and '" + max_area + "')";
当只有一个between ...and的时候是有数据的,两个就没有了;将'" + min_money + "' 、 '" + max_money + "'、 '" + min_area + "' 、'" + max_area + "'改成数字也能显示
求高手指导啊!!~~~ 谢谢了
sql那句写错了*前面没有[
string sqlStr = "select * from Houses where (Hmoney between '" + min_money + "' and '" + max_money + "') and (Harea between '" + min_area + "' and '" + max_area + "')"; 展开
double min_area = Convert.ToDouble(this.textBox5.Text) - Convert.ToDouble(this.textBox5.Text) * 0.1;
double max_money = Convert.ToDouble(this.textBox6.Text) + Convert.ToDouble(this.textBox6.Text) * 0.1;
double min_money = Convert.ToDouble(this.textBox6.Text) - Convert.ToDouble(this.textBox6.Text) * 0.1;
string sqlStr = "select [* from Houses where (Hmoney between '" + min_money + "' and '" + max_money + "') and (Harea between '" + min_area + "' and '" + max_area + "')";
当只有一个between ...and的时候是有数据的,两个就没有了;将'" + min_money + "' 、 '" + max_money + "'、 '" + min_area + "' 、'" + max_area + "'改成数字也能显示
求高手指导啊!!~~~ 谢谢了
sql那句写错了*前面没有[
string sqlStr = "select * from Houses where (Hmoney between '" + min_money + "' and '" + max_money + "') and (Harea between '" + min_area + "' and '" + max_area + "')"; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询