Actually i want to generate a list of applicants (more than 1000) on a view for that i am using sql data reader and genrting a List and passing to Views but it is taking big time(4 to 5 second) to show on View when records are more than 500 is this normal .
{
public static ApplicantsList GetListSend(string category, string subDiv) { string os = "N"; if (category == "SCOS") os = "Y"; Applicant App;//Applicant Class Contains Name,Address,Phone etc//// ApplicantsList AppList = new ApplicantsList();//ApplicantLst Class List type// string sqlcon = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString.ToString(); SqlConnection con = new SqlConnection(sqlcon); con.Open(); string SqlQuery = "SELECT [idno], [ApplicantName], [Address], [Status], convert(varchar(10), DateOfApplication,103) as DateOfApplication FROM [SCOBC] where (status = 'Pending With Dealing Assistant' and category='" + category + "') and SubDiv ='" + subDiv + "' and os ='" + os + "' order by idno"; SqlCommand cmd = new SqlCommand(SqlQuery, con); SqlDataReader sdr = null; sdr = cmd.ExecuteReader(); if (sdr.HasRows) { while (sdr.Read()) { App = new Applicant(); App.IdNo = sdr["idno"].ToString(); App.Name = sdr["ApplicantName"].ToString(); App.Address = sdr["Address"].ToString(); App.Status = sdr["Status"].ToString(); App.DateOfApp = sdr["DateOfApplication"].ToString(); AppList.Add(App);
}
sdr.Close();
con.Close();
}
return AppList;
}
}