private static List <InfoList> GetInfoListFromDB(string procname, string eids, int pageindex, int pagesize, out int pagecount) { SqlParameter[] parameters = { new SqlParameter("@pageIndex", SqlDbType.Int), new SqlParameter("@pageSize", SqlDbType.Int), new SqlParameter("@pageCount", SqlDbType.Int), new SqlParameter("@Temp_Array", SqlDbType.VarChar) }; parameters[0].Value = pageindex; parameters[1].Value = pagesize; parameters[2].Direction = ParameterDirection.Output; parameters[3].Value = eids; DataTable dt = SQLHelper.ProcDataTable(procname, parameters); pagecount = Convert.ToInt32(parameters[2].Value); List <InfoList> data = new List <InfoList>(); DataColumnCollection columns = dt.Columns; foreach (DataRow row in dt.Rows) { InfoList info = new InfoList(); info = info.DBDataToInfo(row, columns); data.Add(info); } return(data); }