对SQL语句还是不熟,只好请教下各位
"UPDATE[user]
SET username= ? ,address= ? ,Email= ?
WHERE (username=?)
AND("+"Email= ? OR ? IS NULL AND Email IS NULL)
AND(address= ? OR ? IS NULL AND addr"+"ess IS NULL) ";
...全文
12118打赏收藏
我的SQL语句哪里错了
对SQL语句还是不熟,只好请教下各位 "UPDATE[user] SET username= ? ,address= ? ,Email= ? WHERE (username=?) AND("+"Email= ? OR ? IS NULL AND Email IS NULL) AND(address= ? OR ? IS NULL AND addr"+"ess IS NULL) ";
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
"UPDATE[user]
SET username= ? ,address= ? ,Email= ?
WHERE (username=?)
AND("+"Email= ? OR ? IS NULL AND Email IS NULL)
AND(address= ? OR ? IS NULL AND addr"+"ess IS NULL) ";----->這一行
改成
...........
AND(address= ? OR ? IS NULL AND addr"+"isnull(ess,'')='')
"UPDATE [user]
SET username= ? ,address= ? ,Email= ?
WHERE (username=?)
AND("+"Email= ? OR (? IS NULL) AND Email IS NULL)
AND(address= ? OR (? IS NULL) AND addr"+"ess IS NULL) ";