日期:2014-05-18 浏览次数:20926 次
StringBuilder strSql = new StringBuilder(); strSql.Append("insert into DialogueQuantity("); strSql.Append("LocalAllCount,NoLocalAllCount,LocalValidCount,NoLocalValidCount,StatisticsDate,ProjectID,UID)"); strSql.Append(" values ("); strSql.Append("@LocalAllCount,@NoLocalAllCount,@LocalValidCount,@NoLocalValidCount,@StatisticsDate,@ProjectID,@UID)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@LocalAllCount", SqlDbType.Int,4), new SqlParameter("@NoLocalAllCount", SqlDbType.Int,4), new SqlParameter("@LocalValidCount", SqlDbType.Int,4), new SqlParameter("@NoLocalValidCount", SqlDbType.Int,4), new SqlParameter("@StatisticsDate", SqlDbType.DateTime,3), new SqlParameter("@ProjectID", SqlDbType.Int,4), new SqlParameter("@UID", SqlDbType.NVarChar,30)}; parameters[0].Value = cqm.LocalAllCount; parameters[1].Value = cqm.NoLocalAllCount; parameters[2].Value = cqm.LocalValidCount; parameters[3].Value = cqm.NoLocalValidCount; parameters[4].Value = cqm.StatisticsDate; parameters[5].Value = cqm.ProjectID; parameters[6].Value = cqm.UID; int resultValue = SqlHelper.ExecuteNonQuery(AES.Decryption(ConfigurationManager.ConnectionStrings ["sqlconn"].ConnectionString,"XXXX"), CommandType.Text, strSql.ToString(), parameters);