public void FillGrid() { try { string strCondi = ""; //strSql = " SELECT TOP 1000 MemberCode,ProfileId,MobileNo,MobileNo_Rel,MobileNo1,MobileNo1_Rel,LandlineNo,MobileNo2_Rel,LandlineNo1,LandlineNo1_Rel FROM tbl_membermaster WHERE isnull(MobileNo_Rel,'')='' "; strCondi += " AND MM.Gender =" + (rbtnMale.Checked == true ? "0" : "1"); if (Convert.ToString(ddlPAgeFrom.SelectedValue) != Convert.ToString(ddlPAgeTo.SelectedValue)) { strCondi += " AND Convert(varchar(4),MM.DateOfBirth,111) Between " + ddlPAgeFrom.Text + " AND " + ddlPAgeTo.Text + ""; } if (Convert.ToInt32(ddlCaste.SelectedValue) > 0) { strCondi += " AND MM.Caste = " + ddlCaste.SelectedValue; } tbl_MemberMasterBAL objMembermaster = new tbl_MemberMasterBAL(); DataSet dtDetails = objMembermaster.GET_Delete_Photos_List(strCondi); if (dtDetails.Tables[0].Rows.Count > 0) { lblTotalCnt.Text = "Total : " + Convert.ToString(dtDetails.Tables[0].Rows.Count); FieldLength = new int[] { 150, 200, 100, 120, 170, 80, 0 }; objGlobal.FillListView(LvwDetails, dtDetails.Tables[0], FieldLength); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }