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 =" + (rdbtnMale.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;
         }
         if (txtProfileId.Text.Trim() != "")
         {
             strCondi += " AND profileid='" + txtProfileId.Text.Trim() + "'";
         }
         tbl_MemberMasterBAL objMembermaster = new tbl_MemberMasterBAL();
         DataSet             dtDetails       = objMembermaster.GET_UPLOAD_PHOTO_PENDING(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, 50, 50, 0 };
             objGlobal.FillListView(LvwDetails, dtDetails.Tables[0], FieldLength);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void btnPrint_Click(object sender, EventArgs e)
 {
     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 =" + (rdbtnMale.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_UPLOAD_PHOTO_PENDING(strCondi);
         if (dtDetails.Tables[0].Rows.Count > 0)
         {
             frmReportViewer objReportViewer = new frmReportViewer();
             ReportDocument  cryRpt          = new ReportDocument();
             string          strPath         = "";
             strPath = Application.StartupPath + @"\REPORTS\PhotoUploadPending.rpt";
             cryRpt.Load(strPath);
             cryRpt.SetDataSource(dtDetails.Tables[0]);
             objReportViewer.RptViewer.ReportSource = cryRpt;
             objReportViewer.RptViewer.Refresh();
             objReportViewer.ShowDialog();
             objReportViewer.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }