SqlParameter 中 top 的使用
public DataTable GetAdminTopDCSCheckReport(int top) { StringBuilder strSql = new StringBuilder(); strSql.Append(" select top (@top) * from [T_Report] where IsSave=1 and IsCheck1= 0 and IsCheck2= 0 order by submittime desc"); SqlParameter[] parameters = { new SqlParameter("@top", SqlDbType.Int,4) }; parameters[0].Value = top; return DBase.GetDataTable(strSql.ToString(),parameters); }