public bool ModifyDrawBill(MDrawBill mBill)
{
StringBuilder strSQLText = new StringBuilder();
strSQLText.Append("update DrawBill set ");
OracleParameter[] param =
{
new OracleParameter("PKID", OracleType.Int32),
new OracleParameter("StationId", OracleType.VarChar),
new OracleParameter("BillBegin", OracleType.VarChar),
new OracleParameter("BillEnd", OracleType.VarChar),
new OracleParameter("SumCount", OracleType.Int32),
new OracleParameter("DrawDate", OracleType.DateTime),
new OracleParameter("IsConfirm", OracleType.Int32),
new OracleParameter("AppUser", OracleType.NVarChar),
new OracleParameter("CheckUser", OracleType.NVarChar),
new OracleParameter("Memo", OracleType.NVarChar)
};
//@@lwd 20110803
param[0].Value = mBill.PKID;
if (mBill.StationId != null)
{
strSQLText.Append("StationId=:StationId,");
param[1].Value = mBill.StationId;
}
if (mBill.BillBegin != null)
{
strSQLText.Append("BillBegin=:BillBegin,");
param[2].Value = mBill.BillBegin;
}
if (mBill.BillEnd != null)
{
strSQLText.Append("BillEnd=:BillEnd,");
param[3].Value = mBill.BillEnd;
}
if (mBill.SumCount != null)
{
strSQLText.Append("SumCount=:SumCount,");
param[4].Value = mBill.SumCount;
}
if (mBill.DrawDate != null)
{
strSQLText.Append("DrawDate=:DrawDate,");
param[5].Value = mBill.DrawDate;
}
if (mBill.IsConfirm != null)
{
strSQLText.Append("IsConfirm=:IsConfirm,");
param[6].Value = mBill.IsConfirm;
}
if (mBill.AppUser != null)
{
strSQLText.Append("AppUser=:AppUser,");
param[7].Value = mBill.AppUser;
}
if (mBill.CheckUser != null)
{
strSQLText.Append("CheckUser=:CheckUser,");
param[8].Value = mBill.CheckUser;
}
if (mBill.Memo != null)
{
strSQLText.Append("Memo=:Memo,");
param[9].Value = mBill.Memo;
}
if (strSQLText.ToString().EndsWith(","))
{
strSQLText = strSQLText.Remove(strSQLText.ToString().Length - 1, 1);
}
strSQLText.Append(" where PKID=:PKID ");
return OracleHelper.ExecuteNonQuery(OracleHelper.Connection_String, CommandType.Text, strSQLText.ToString(), param) > 0;//提示“RA-01036: 非法的变量名/编号” }
有关键字?我记得用mvc+ef+mysql做一个网站的时候,怎么都不让添加,后来sql直接放到客户端里面,还是报错,最后才知道其中一个列名叫location,mysql貌似是关键字。。。