Ejemplo n.º 1
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         this.Hide();
         Cursor         = Cursors.WaitCursor;
         timer1.Enabled = true;
         frmclassfeepaymentReport frm = new  frmclassfeepaymentReport();
         RptclassFeePayment       rpt = new  RptclassFeePayment();
         //The report you created.
         SqlConnection  myConnection = default(SqlConnection);
         SqlCommand     MyCommand    = new SqlCommand();
         SqlDataAdapter myDA         = new SqlDataAdapter();
         ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
         myConnection          = new SqlConnection(cs.DBcon);
         MyCommand.Connection  = myConnection;
         MyCommand.CommandText = "select * from CourseFeePayment,student where student.AdmissionNo=courseFeePayment.AdmissionNo and CourseFeePayment.ID= '" + txtFeePaymentID.Text + "'";
         MyCommand.CommandType = CommandType.Text;
         myDA.SelectCommand    = MyCommand;
         myDA.Fill(myDS, "CourseFeePayment");
         myDA.Fill(myDS, "Student");
         // myDA.Fill(myDS, "CourseFeePayment_join");
         rpt.SetDataSource(myDS);
         frm.crystalReportViewer1.ReportSource = rpt;
         frm.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 2
0
        private void ScholarNo_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptBusFeesPaymentsReport rpt = new RptBusFeesPaymentsReport();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select *  from BusFeePayment,Student,Transportation,BusHolders where Student.AdmissionNo=BusHolders.AdmissionNo and BusFeePayment.AdmissionNo=Student.AdmissionNo and Transportation.SourceLocation=BusHolders.SourceLocation and Student.AdmissionNo ='" + AdmissionNo.Text + "' order by DateOfPayment";

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "BusFeePayment");
                myDA.Fill(myDS, "Transportation");
                myDA.Fill(myDS, "BusHolders");
                myDA.Fill(myDS, "Student");
                rpt.SetDataSource(myDS);

                crystalReportViewer2.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void button10_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptClassFeePaymentsReport rpt = new RptClassFeePaymentsReport();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select *  from CourseFeePayment,Student where Student.Admissionno=CourseFeePayment.AdmissionNo and PaymentDate between @date1 and @date2 order by PaymentDate";
                MyCommand.Parameters.Add("@date1", SqlDbType.DateTime, 30, "PaymentDate").Value = PaymentDateFrom.Value.Date;
                MyCommand.Parameters.Add("@date2", SqlDbType.DateTime, 30, "PaymentDate").Value = PaymentDateTo.Value.Date;

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "CourseFeePayment");
                myDA.Fill(myDS, "Student");
                rpt.SetDataSource(myDS);

                crystalReportViewer3.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void Print_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                FrmBusFeeReceipt        frm = new FrmBusFeeReceipt();
                RptBusFeePaymentReceipt rpt = new RptBusFeePaymentReceipt();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select *  from BusFeePayment,Student,Transportation,BusHolders where Student.AdmissionNo=BusHolders.AdmissionNo and BusFeePayment.AdmissionNo=Student.AdmissionNo and Transportation.SourceLocation=BusHolders.SourceLocation and FeePaymentID= '" + FeePaymentID.Text + "'";
                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "BusFeePayment");
                myDA.Fill(myDS, "Transportation");
                myDA.Fill(myDS, "BusHolders");
                myDA.Fill(myDS, "Student");
                rpt.SetDataSource(myDS);
                frm.crystalReportViewer1.ReportSource = rpt;
                frm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 5
0
 private void Print_Click(object sender, EventArgs e)
 {
     try
     {
         Cursor         = Cursors.WaitCursor;
         timer1.Enabled = true;
         SalaryPaymentReceipt      rpt          = new SalaryPaymentReceipt(); //The report you created.
         SqlConnection             myConnection = default(SqlConnection);
         SqlCommand                MyCommand    = new SqlCommand();
         SqlDataAdapter            myDA         = new SqlDataAdapter();
         ERPS_DBDataSet            myDS         = new ERPS_DBDataSet(); //The DataSet you created.
         frmEmployeePaymentReceipt frm          = new frmEmployeePaymentReceipt();
         myConnection          = new SqlConnection(cs.DBcon);
         MyCommand.Connection  = myConnection;
         MyCommand.CommandText = "select * from EmployeePayment,Employee where Employee.StaffID=EmployeePayment.StaffID and EmpPaymentID='" + PaymentID.Text + "'";
         MyCommand.CommandType = CommandType.Text;
         myDA.SelectCommand    = MyCommand;
         myDA.Fill(myDS, "EmployeePayment");
         myDA.Fill(myDS, "Employee");
         rpt.SetDataSource(myDS);
         frm.crystalReportViewer1.ReportSource = rpt;
         frm.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 6
0
        private void AdmissionNo_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptScholarshipPaymentReport rpt = new RptScholarshipPaymentReport();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select *  from ScholarshipPayment,Student,Scholarship where Student.AdmissionNo=ScholarshipPayment.AdmissionNo and ScholarShipPayment.ScholarshipID=Scholarship.ScholarShipID and scholarshippayment.admissionNo='" + AdmissionNo.Text + "' order by PaymentDate ";

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "ScholarshipPayment");
                myDA.Fill(myDS, "Student");
                myDA.Fill(myDS, "Scholarship");
                rpt.SetDataSource(myDS);

                crystalReportViewer2.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void txtSourceLocation_TextChanged(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptBusHoders rpt = new RptBusHoders();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();

                ERPS_DBDataSet myDS = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select * from BusHolders,Student where Student.AdmissionNo=BusHolders.AdmissionNo and SourceLocation Like '" + txtSourceLocation.Text + "%' order by Studentname ";

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "BusHolders");
                myDA.Fill(myDS, "Student");

                rpt.SetDataSource(myDS);

                crystalReportViewer5.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                frmEventReport frm = new frmEventReport();

                rptEventsReport1 rpt = new rptEventsReport1();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select *  from Event";

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "Event");
                rpt.SetDataSource(myDS);
                frm.crystalReportViewer1.ReportSource = rpt;
                frm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void cmbSourceLocation_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptBusHoders rpt = new RptBusHoders();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();

                ERPS_DBDataSet myDS = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select distinct BusHolders.AdmissionNo, BusHolders.SourceLocation, BusHolders.StartingDate, Student.AdmissionNo AS Expr1, Student.EnrollmentNo, Student.StudentName, Student.FatherName, Student.MotherName,Student.FatherCN, Student.PermanentAddress, Student.TemporaryAddress, Student.ContactNo, Student.EmailID, Student.DOB, Student.Gender, Student.AdmissionDate, Student.Session, Student.Caste,Student.Religion, Student.Status, Student.Nationality, Student.Class, Student.Section, Student.SchoolID FROM BusHolders INNER JOIN Student ON BusHolders.AdmissionNo = Student.AdmissionNo where SourceLocation= '" + cmbSourceLocation.Text + "' order by Studentname ";

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "BusHolders");
                myDA.Fill(myDS, "Student");

                rpt.SetDataSource(myDS);

                crystalReportViewer5.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 10
0
        private void cmbStaffName_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptSalarypaymentsReport rpt = new RptSalarypaymentsReport();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.
                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select *  from EmployeePayment,Employee where EmployeePayment.StaffID=Employee.StaffID and Employee.Staffname= '" + cmbStaffName.Text + "' order by PaymentDate";
                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "EmployeePayment");
                myDA.Fill(myDS, "Employee");
                rpt.SetDataSource(myDS);

                crystalReportViewer1.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void AdmissionNo_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptHostelFeePaymentReport rpt = new RptHostelFeePaymentReport();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select * FROM   Student INNER JOIN Hosteler ON Student.AdmissionNo = Hosteler.AdmissionNo INNER JOIN HostelFeePayment ON Student.AdmissionNo = HostelFeePayment.AdmissionNo and hostelfeepayment.admissionNo='" + AdmissionNo.Text + "'order by DateOfPayment";


                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "HostelFeePayment");
                myDA.Fill(myDS, "Hostelinfo");
                myDA.Fill(myDS, "Hosteler");
                myDA.Fill(myDS, "Student");
                rpt.SetDataSource(myDS);

                crystalReportViewer2.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 12
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (Course.Text == "")
            {
                MessageBox.Show("Please select class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Course.Focus();
                return;
            }
            if (Branch.Text == "")
            {
                MessageBox.Show("Please select Section", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Branch.Focus();
                return;
            }
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptBusFeesPaymentsReport rpt = new RptBusFeesPaymentsReport();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select *  from BusFeePayment,Student,Transportation,BusHolders where Student.AdmissionNo=BusHolders.AdmissionNo and BusFeePayment.AdmissionNo=Student.AdmissionNo and Transportation.SourceLocation=BusHolders.SourceLocation and DateOfPayment between @date1 and @date2 and class ='" + Course.Text + "'and Section='" + Branch.Text + "' order by DateOfPayment";
                MyCommand.Parameters.Add("@date1", SqlDbType.DateTime, 30, "DateOfPayment").Value = Date_from.Value.Date;
                MyCommand.Parameters.Add("@date2", SqlDbType.DateTime, 30, "DateOfPayment").Value = Date_to.Value.Date;

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "BusFeePayment");
                myDA.Fill(myDS, "Transportation");
                myDA.Fill(myDS, "BusHolders");
                myDA.Fill(myDS, "Student");
                rpt.SetDataSource(myDS);

                crystalReportViewer1.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void button5_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmbclass.Text == "")
                {
                    MessageBox.Show("Please select class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    cmbclass.Focus();
                    return;
                }
                if (cmbSection.Text == "")
                {
                    MessageBox.Show("Please select Section", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    cmbSection.Focus();
                    return;
                }
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptBusHoders rpt = new RptBusHoders();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();

                ERPS_DBDataSet myDS = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select * from BusHolders,Student where Student.AdmissionNo=BusHolders.AdmissionNo and StartingDate between @date1 and @date2 and Class= '" + cmbclass.Text + "'and Section='" + cmbSection.Text + "' order by Studentname ";
                MyCommand.Parameters.Add("@date1", SqlDbType.DateTime, 30, "StartingDate").Value = Date_from.Value.Date;
                MyCommand.Parameters.Add("@date2", SqlDbType.DateTime, 30, "StartingDate").Value = Date_to.Value.Date;

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "BusHolders");
                myDA.Fill(myDS, "Student");

                rpt.SetDataSource(myDS);

                crystalReportViewer1.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (AdmissionNo.Text == "")
            {
                MessageBox.Show("Please select Admission no.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                AdmissionNo.Focus();
                return;
            }

            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptClassFeePaymentsReport rpt = new RptClassFeePaymentsReport();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new  ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select *  from CourseFeePayment,Student where CourseFeePayment.AdmissionNo=Student.AdmissionNo and CourseFeePayment.AdmissionNo= '" + AdmissionNo.Text + "'order by PaymentDate";

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "CourseFeePayment");
                myDA.Fill(myDS, "Student");
                rpt.SetDataSource(myDS);

                crystalReportViewer2.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void Print_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                frmHostelFeeReceipt frm = new frmHostelFeeReceipt();

                RptHostelerfeePayment rpt = new RptHostelerfeePayment();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select *  from HostelFeePayment,Student,Hostelinfo,Hosteler where Student.AdmissionNo=Hosteler.AdmissionNo and HostelFeePayment.AdmissionNo=Student.AdmissionNo and Hostelinfo.HostelName=Hosteler.Hostelname and HFeePaymentID= '" + FeePaymentID.Text + "'";

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "HostelFeePayment");
                myDA.Fill(myDS, "Hostelinfo");
                myDA.Fill(myDS, "Hosteler");
                myDA.Fill(myDS, "Student");
                rpt.SetDataSource(myDS);
                frm.crystalReportViewer1.ReportSource = rpt;
                frm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void button14_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor         = Cursors.WaitCursor;
                timer1.Enabled = true;
                RptHostelFeePaymentReport rpt = new RptHostelFeePaymentReport();
                //The report you created.
                SqlConnection  myConnection = default(SqlConnection);
                SqlCommand     MyCommand    = new SqlCommand();
                SqlDataAdapter myDA         = new SqlDataAdapter();
                ERPS_DBDataSet myDS         = new ERPS_DBDataSet();
                //The DataSet you created.


                myConnection          = new SqlConnection(cs.DBcon);
                MyCommand.Connection  = myConnection;
                MyCommand.CommandText = "select * FROM   Student INNER JOIN Hosteler ON Student.AdmissionNo = Hosteler.AdmissionNo INNER JOIN HostelFeePayment ON Student.AdmissionNo = HostelFeePayment.AdmissionNo and DateOfPayment between @date1 and @date2 and fine > 0 order by DateOfPayment";
                MyCommand.Parameters.Add("@date1", SqlDbType.DateTime, 30, "DateOfPayment").Value = dateTimePicker1.Value.Date;
                MyCommand.Parameters.Add("@date2", SqlDbType.DateTime, 30, "DateOfPayment").Value = dateTimePicker2.Value.Date;

                MyCommand.CommandType = CommandType.Text;
                myDA.SelectCommand    = MyCommand;
                myDA.Fill(myDS, "HostelFeePayment");
                myDA.Fill(myDS, "Hostelinfo");
                myDA.Fill(myDS, "Hosteler");
                myDA.Fill(myDS, "Student");
                rpt.SetDataSource(myDS);

                crystalReportViewer5.ReportSource = rpt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }