大师们,
我在数据源控件中有select语句,里面有条件T_traintype.trainname IN (@trainname)
我把(@trainname这个变量绑定在label的text属性上,点击按钮把复选框里面的值都放在label里面,但是label的text属性
值是“'动车','普快'” 有引号的,我不知道怎么去掉它
select * from dbo.T_traintype where trainname in ('动车','普快')
还有我怎么有个字符型时间2010-08-08  怎么和数据库里面的日期型想比较,我数据库里面的日期还是有几点几分的,比较是相同的日期

解决方案 »

  1.   

    不会想个办法搞掉啊,replace("'","") ,substring() ======
      

  2.   

    SQL 中不是用单引号的,但是在。NET里面是双引号
      

  3.   

    T_traintype.trainname IN (@trainname)
    这个语句中的变量是字符型不行啊
      

  4.   

            if (CheckBox2.Checked)
                Label4.Text += "'" + CheckBox2.Text + "'" + ",";
            if (CheckBox3.Checked)
                Label4.Text += "'" + CheckBox3.Text + "'" + ",";
            if (CheckBox4.Checked)
                Label4.Text += "'" + CheckBox4.Text + "'" + ",";
            if (CheckBox5.Checked)
                Label4.Text += "'" + CheckBox5.Text + "'" + ",";
            if (CheckBox6.Checked)
                Label4.Text += "'" + CheckBox6.Text + "'" + ",";
            Label4.Text = Label4.Text.Substring(0, Label4.Text.Length - 1);
    这个label4是变量的值
      

  5.   

            if (CheckBox2.Checked)
                Label4.Text += "'" + CheckBox2.Text + "'" + ",";
            if (CheckBox3.Checked)
                Label4.Text += "'" + CheckBox3.Text + "'" + ",";
            if (CheckBox4.Checked)
                Label4.Text += "'" + CheckBox4.Text + "'" + ",";
            if (CheckBox5.Checked)
                Label4.Text += "'" + CheckBox5.Text + "'" + ",";
            if (CheckBox6.Checked)
                Label4.Text += "'" + CheckBox6.Text + "'" + ",";
            Label4.Text = Label4.Text.Substring(0, Label4.Text.Length - 1);
    这个label4是变量的值
      

  6.   


    晕死。哪一个数据库系统支持这种东西?你确定sql server有这种东西?使用变量之前,请先学好t-sql语法。不要拿个棒槌、见缝就要插一插。
      

  7.   

    string ss = this.TextBox1.Text;
    string tt= ss.Replace(@"""","");
    Response.Write(tt);
      

  8.   

    string ss = this.TextBox1.Text;
    string tt= ss.Replace(@"""","");
    Response.Write(tt);