private void BindGV(GridView gv, string tableName, int size, int pageindex, int isAsc, string OderColumName,string KeyID, string condictions)
{
using (SqlDataObject sodo = new SqlDataObject())
{
SqlParameter[] sps = new SqlParameter[7];
sps[0] = new SqlParameter("@TableName", tableName);
sps[1] = new SqlParameter("@PageSize", size);
sps[2] = new SqlParameter("@PageIndex", pageindex);
sps[3] = new SqlParameter("@IsAsc", 1);
sps[4] = new SqlParameter("@OderColumName", OderColumName);
sps[5] = new SqlParameter("@KeyID", KeyID);
sps[6] = new SqlParameter("@Conditions", condictions);
DataTable dt = sodo.getDataTable("sp", "sp_CTE", sps);
gv.DataSource = dt.DefaultView;
gv.DataBind();
}
}
{
using (SqlDataObject sodo = new SqlDataObject())
{
SqlParameter[] sps = new SqlParameter[7];
sps[0] = new SqlParameter("@TableName", tableName);
sps[1] = new SqlParameter("@PageSize", size);
sps[2] = new SqlParameter("@PageIndex", pageindex);
sps[3] = new SqlParameter("@IsAsc", 1);
sps[4] = new SqlParameter("@OderColumName", OderColumName);
sps[5] = new SqlParameter("@KeyID", KeyID);
sps[6] = new SqlParameter("@Conditions", condictions);
DataTable dt = sodo.getDataTable("sp", "sp_CTE", sps);
gv.DataSource = dt.DefaultView;
gv.DataBind();
}
}
还是系统封装好了直接调用的类啊?