SQL中的操作
时间:2011-04-07 来源:pramezh
public void Update(string modifyBy)
{
string strInsert = "update PcrChangeType set ChgType_Desc=@ChgTypeDesc,Modify_Id=@modifyBy,Modify_Date=(select CONVERT(varchar(12) , getdate(), 111 )+' '+CONVERT(varchar(12),getdate(), 108 )) where Customer_ID=@customer and ChgType_Id=@ChgTypeNo";
SqlParameter[] param = new SqlParameter[]{
new SqlParameter("@customer", SqlDbType.NVarChar,10),
new SqlParameter("@ChgTypeNo",SqlDbType.NVarChar,10),
new SqlParameter("@ChgTypeDesc",SqlDbType.NVarChar,50),
new SqlParameter("@modifyBy",SqlDbType.NVarChar,10),
};
param[0].Value = this.Customer;
param[1].Value = this.ChangeTypeNo;
param[2].Value = this.ChangeTypeDesc;
param[3].Value = modifyBy;
int i = SQLHelper.ExecuteNonQuery(strInsert, param);
}