坑人的引用类型。。。。输出看看结果是什么
QueuestrStranList = new Queue ();StringBuilder strSql = new StringBuilder(); strSql.Append("Update Jia72_Members Set "); strSql.Append("UserName=@UserName,"); strSql.Append("YTCardId=@YTCardId,"); strSql.Append("CardNum=@CardNum,"); strSql.Append("Bank=@Bank,"); strSql.Append("BankNumber=@BankNumber,"); strSql.Append("QQNumber=@QQNumber,"); strSql.Append("RealName=@RealName,"); strSql.Append("SavedOn=@SavedOn"); strSql.Append(" Where Id=@Id "); string strSQLM = strSql.ToString(); SqlParameter[] parameters = { new SqlParameter("@Id",SqlDbType.Int,4), new SqlParameter("@UserName",SqlDbType.NVarChar,20), new SqlParameter("@YTCardId",SqlDbType.Int,4), new SqlParameter("@CardNum",SqlDbType.NVarChar,20), new SqlParameter("@Bank",SqlDbType.NVarChar,50), new SqlParameter("@BankNumber",SqlDbType.NVarChar,32), new SqlParameter("@QQNumber",SqlDbType.NVarChar,50), new SqlParameter("@RealName",SqlDbType.NVarChar,10), new SqlParameter("@SavedOn",SqlDbType.DateTime) }; parameters[0].Value = model.Id; parameters[1].Value = model.UserName; parameters[2].Value = model.YTCardId; parameters[3].Value = model.CardNum; parameters[4].Value = model.Bank; parameters[5].Value = model.BankNumber; parameters[6].Value = model.QQNumber; parameters[7].Value = model.RealName; parameters[8].Value = model.SavedOn; DBUtility.ParaInfo dbcom = new DBUtility.ParaInfo(strSql.ToString(), parameters); strStranList.Enqueue(dbcom);//绑定会员信息 //更新卡表 strSql.Clear(); strSql.Append("update Jia72_YTCard set "); strSql.Append("IsBind=1,"); strSql.Append("SavedOn=getdate()"); strSql.Append(" where Id=" + model.YTCardId); DBUtility.ParaInfo dbcom1 = new DBUtility.ParaInfo(strSql.ToString(), null); strStranList.Enqueue(dbcom1);//绑定会员信息 //更新卡表绑定
while (strStranList.Count > 0) { ParaInfo myDE = strStranList.Peek(); string cmdText = myDE.strSql.ToString(); Response.Write(cmdText.ToString()); Response.Write(""); if (myDE.par != null) { SqlParameter[] cmdParms = (SqlParameter[])myDE.par; foreach (SqlParameter parm in cmdParms) { Response.Write(parm.ParameterName.ToString() + " " + parm.Value.ToString() + " "); } Response.Write(""); } strStranList.Dequeue(); }