private void open_Notification() { DatabaseConnection dbCon = new DatabaseConnection(); string str = " Select c.SName,d.SCourseName,iif(max(f.SRefNo) is Null, '', max(f.SRefNo)) as Payment_RefNo, " + " iif(max(f.DDate) is null,'',max(f.ddate)) as Payment_Date,NBalanceAmount as Balance_Amount, " + " (datediff(DAY,max(f.DDate),getdate())-1-((count(e.SRefNo))*NPayInDays)) as Overdue_Days from " + " File_InvoiceH a inner join File_InvoiceD b on a.SRefNo=b.SRefNo inner join File_Student c " + " on c.SStudentId=a.SStudentId inner join File_Course d on d.SCourseCode=b.SCourseCode " + " left join File_PaymentD e on e.SInvNo=a.SRefNo left join File_PaymentH f on f.SRefNo=e.SRefNo " + " where a.NBalanceAmount>0.00 group by a.SRefNo,a.DDate,a.SStudentId,c.SName,NBalanceAmount,NPayInDays, " + " d.SCourseName,SCourseName having (datediff(DAY,max(f.DDate),getdate()))-1 > ((count(e.SRefNo))*NPayInDays) "; DataSet newDataSet = dbCon.Get(str); if (newDataSet.Tables[0].Rows.Count > 0) { Notification newForm = new Notification(newDataSet); openForm.openChildForm(newForm, this, "Notification"); } //Notification newForm = new Notification(); //newForm.ShowInTaskbar = false; //newForm.MdiParent = this; //newForm.Show(); }