asp.net sql语句中where条件存在中文在程序中取不出数据,在数据库中可以正常取值,数据库为oracle
sql 语句如下:
string sql = string.Format(@"SELECT FHANDLEDATE,FNAME_L2,CFHANDLEDONE,FHANDLEPERSON FROM CT_QUE_PROBLEMVIEW INNER JOIN CT_QUE_PROBLEMVIEWENTRY ON CT_QUE_PROBLEMVIEW.FID = CT_QUE_PROBLEMVIEWENTRY.FPARENTID INNER JOIN CT_QUE_PROBLEMVIEWENTRYS2 ON CT_QUE_PROBLEMVIEW.FID=CT_QUE_PROBLEMVIEWENTRYS2.FPARENTIDINNER JOIN T_ORG_SALE ON CT_QUE_PROBLEMVIEW.FDEPARTMENTID = T_ORG_SALE.FID WHERE CFHANDLEDONE IN (N'完成',N'受理',N'勘察') AND CT_QUE_PROBLEMVIEW.FNUMBER='{0}' ORDER BY FHANDLEDATE ", number);
下面的这句where条件存在中文,所以在asp.net中取不出数据,我把CFHANDLEDONE IN (N'完成',N'受理',N'勘察')去掉可以取出数据,但不符合客户要求,数据库为oracle,并且方法oracle查询窗口可以正常取数据,所以语句不存在问题。
----------------------------------------------------------------------------------------------WHERE CFHANDLEDONE IN (N'完成',N'受理',N'勘察') AND CT_QUE_PROBLEMVIEW.FNUMBER='{0}' ORDER BY FHANDLEDATE ", number);