例子:
有一句SQL语句是这样的:
 sql = "select * from assess_rec where id>=1 and id<=5";我发现执行结果不正确,
用一个TextBox显示出来,
发现SQL语句变成这样了:
       select * from assess_rec where id>=1 and id&lt;=5
请问如何解决?谢谢!

解决方案 »

  1.   

    string sql;
    sql = "select * from assess_rec where id>=1 and id<=5";
    TextBox1.Text = sql;
      

  2.   

    不应该啊.&lt;东东在html中就是>你要不用
    string sql;
    sql = "select * from assess_rec where Id BETWEEN 1 AND 5";
    TextBox1.Text = sql;
      

  3.   

    string sql = @"select * from assess_rec where Id BETWEEN 1 AND 5";
    试一下
      

  4.   

    我是用了magicajax控件
    用between and 这个是没有问题的!
      

  5.   

    protected void Button1_Click(object sender, EventArgs e)
        {
            string sql;
            sql = "select * from assess_rec where id>=1 and id<=5";
            TextBox1.Text = sql;
        }把TextBox1,Button1都放在AjaxPanel1上就会出现上述问题,如果把Button1不放在AjaxPanel1上(但这样就会刷新了),TextBox1放在AjaxPanel1上就不会出现上述问题
      

  6.   

    select * from assess_rec where id between 1 and 5
      

  7.   

    sql = "select * from assess_rec where Id BETWEEN 1 AND 5";
      

  8.   

    //先html编码
    String TestString = "This is a <Test String>.";
    String EncodedString = Server.HtmlEncode(TestString);
    再html解码就可以了
    string decodeString Server.HtmlDecode(EncodedString);
      

  9.   

    sqshine() 的方法还是不行呀!虽然上面用between and 可以解决此问题,但是如何要输出字符串问题还是没有解决呀!就如sqshine() 这样,我找了一下,元谋人的小山洞  http://mildwolf.spaces.live.com/
    里提到已经解决此问题了,但具体如何实现没有写出来,
    只提到:
    另外,在MagicAjax使用过程中又陆续有一些问题,比较严重的有以下两个:
    1。文本框中如果含有双引号的字符,在通过magicAjax环回一次后,符号被转义。 
    2。在ie6的环境中,如果使用了MagicAjax页面出现横向滚动条,会无限延伸。
     
    这两部分的问题。我都已经修正了,不过要改动要MagicAjax的Source。谢谢!各位在用的时候没有碰到此问题?
      

  10.   

    相互换一下就可以了么,< 等价于&lt;  &lt; 等价于<