http://blog.csdn.net/yw1688/archive/2009/05/08/4161387.aspx在执行
exec proc_paged_2part_selectMax 'tb_testTable','ID,userName,userPWD,userEmail',10,100000,'ID',0,null,'ID',0
没有问题
但是我这些带条件的时候
exec proc_paged_2part_selectMax 'tb_testTable','ID,userName,userPWD,userEmail',10,100000,'ID',0,userName='admin','ID',0报错:
消息 102,级别 15,状态 1,第 1 行
'=' 附近有语法错误。帮忙看看!

解决方案 »

  1.   

    exec proc_paged_2part_selectMax 'tb_testTable','ID,userName,userPWD,userEmail',10,100000,'ID',0,'admin','ID',0 
    试试
      

  2.   

    exec proc_paged_2part_selectMax 'tb_testTable','ID,userName,userPWD,userEmail',10,100000,'ID',0,userName='admin','ID',0 
    这里应该不用显示指定了吧,这里只是个值,对应参数就好了
      

  3.   

    你那个查询里有WHERE 吗?
    exec proc_paged_2part_selectMax 'tb_testTable','ID,userName,userPWD,userEmail',10,100000,'ID',0,userName='admin','ID',0 
    在存储过程里面,把那个语句PRINT出来看看。
      

  4.   

    参数能这么传么??检查下你的查询语句 
    PRINT 查询语句看看错误在哪里。
      

  5.   

    --try
    exec proc_paged_2part_selectMax 'tb_testTable','ID,userName,userPWD,userEmail',10,100000,'ID',0, 'and userName=''admin''','ID',0
      

  6.   

    这样试试,你那个条件要这么写。
    'userName=''admin'''
      

  7.   

    exec proc_paged_2part_selectMax 'tb_testTable','ID,userName,userPWD,userEmail',10,100000,'ID',0,@userName='admin','ID',0 
      

  8.   


     strwheres += " and  CardNumber= ''" + CardNumber + "''  ";
    但是在c#中不行的 在sql中行
    exec proc_paged_2part_selectMax 'Drs_u_userCard','Id, CardId,CardNumber,CardPwd,createTime,umoney,Point,isBuy,isUse,isLock,UserNum,siteID,TimeOutDate',5,1,'ID',0,'and CardNumber=''FS0763006028591''','ID',0
      

  9.   

    strwheres += " and  CardNumber= '" + CardNumber + "'  ";
    这样吧。
      

  10.   

    可以啦 是我错 写错了 
     strwheres += "  and  CardNumber= '" + CardNumber + "'  ";