前台Brand.aspx页面代码:加上ChAR(39)就没有错误了,有点困惑,Sql Procedure如图:列名无效

解决方案 »

  1.   

    加上ChAR(39)就没有错误了,有点困惑单引号  
    报什么错误
      

  2.   

    你string 里面那个 A 没有吧  ,,应该是这儿的问题
      

  3.   

    你认为  
        where order=1234 
    和 
        where order='1234' 
    一样吗?
      

  4.   

    当然不一样,只是用char(39)写法我没有体会过。
      

  5.   

    我有一张表Shop,在添加记录的时候是按照字母顺序进行排列的,前台绑定读取:比如首字母是“A”的品牌有几个。
      

  6.   


    如果你看不懂 char(39)的写法,你可以 看看这个print 'select * from TableName where id = '+char(39)+'1234'+char(39)
    print 'select * from TableName where id = '''+'1234'+''''
    print 'select * from TableName where id = ''1234'''/*
    Result:
    -----------------------------------------
    select * from TableName where id = '1234'
    select * from TableName where id = '1234'
    select * from TableName where id = '1234'*/
    、、、、
      

  7.   


    如果你看不懂 char(39)的写法,你可以 看看这个print 'select * from TableName where id = '+char(39)+'1234'+char(39)
    print 'select * from TableName where id = '''+'1234'+''''
    print 'select * from TableName where id = ''1234'''/*
    Result:
    -----------------------------------------
    select * from TableName where id = '1234'
    select * from TableName where id = '1234'
    select * from TableName where id = '1234'*/
    、、、、
    有点意思,收藏了。