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 行
'=' 附近有语法错误。帮忙看看!
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 行
'=' 附近有语法错误。帮忙看看!
试试
这里应该不用显示指定了吧,这里只是个值,对应参数就好了
exec proc_paged_2part_selectMax 'tb_testTable','ID,userName,userPWD,userEmail',10,100000,'ID',0,userName='admin','ID',0
在存储过程里面,把那个语句PRINT出来看看。
PRINT 查询语句看看错误在哪里。
exec proc_paged_2part_selectMax 'tb_testTable','ID,userName,userPWD,userEmail',10,100000,'ID',0, 'and userName=''admin''','ID',0
'userName=''admin'''
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
这样吧。
strwheres += " and CardNumber= '" + CardNumber + "' ";