“ select  price  from  products  where  price between   X  and  Y ”.其中的X和Y用TextBox1.Text 和 TextBox2.Text来代替. 请各位高手们帮一下..谢谢

解决方案 »

  1.   

    "select  price  from  products  where  price between  " + TextBox1.Text  + "  and  " + TextBox2.Text
      

  2.   

    string sqltext="select  price  from  products  where  price between  " + TextBox1.Text  + "  and  " + TextBox2.Text;
      

  3.   

    string strSql
    =string.Format(@“ select  price  from  products  where  price between  {0}  and  {1}”,TextBox1.Text,TextBox2.Text)
      

  4.   

    C#中的sql语句有什么区别吗?
    跟平常写的一样,就是条件参数化楼上都有直接的sql,你也可以参照参数化的sql字符串
      

  5.   

    string strSql = string.Format("SELECT PRICE FROM PRODUCTS WHERE PRICE BETWEEN {0} AND {1}",TextBox1.Text,TextBox2.Text);
      

  6.   

    string sqltext="select  price  from  products  where  price between  " + TextBox1.Text  + "  and  " + TextBox2.Text;
    ================================================================================================
    string strSql 
    =string.Format(@“ select  price  from  products  where  price between  {0}  and  {1}”,TextBox1.Text,TextBox2.Text);
      

  7.   

    string sqltext="select  price  from  products  where  price between  '" + TextBox1.Text  + "'  and  '" + TextBox2.Text+"'";