private void BindData()
        {
            string Data    = "SELECT * From Regstudent";
            var    getdata = new lib.DatabaseConnection();

            dt = new DataTable();
            dt = getdata.getTable(Data);
            foreach (DataRow dr in dt.Rows)
            {
                dataStudentView.Rows.Add();
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["SID"].Value           = dr["Id"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["RollNo"].Value        = dr["RollNo"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["StudentName"].Value   = dr["StudentName"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["Gender"].Value        = dr["Gender"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["Address"].Value       = dr["Address"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["DOB"].Value           = dr["DateOfBirth"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["AdmissionDate"].Value = dr["AdmissionDate"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["PhoneNo"].Value       = dr["PhoneNo"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["Email"].Value         = dr["Email"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["Country"].Value       = dr["Country"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["Shift"].Value         = dr["Shift"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["Course"].Value        = dr["Course"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["Semester"].Value      = dr["Semester"];
                dataStudentView.Rows[dataStudentView.Rows.Count - 1].Cells["StudentPic"].Value    = dr["StudentPic"];
            }
        }
Ejemplo n.º 2
0
        private void BindData()
        {
            string    Data    = "SELECT * From FeeManage";
            var       getdata = new lib.DatabaseConnection();
            DataTable dt      = new DataTable();

            dt = getdata.getTable(Data);
            foreach (DataRow dr in dt.Rows)
            {
                dataGridFeeManage.Rows.Add();
                dataGridFeeManage.Rows[dataGridFeeManage.Rows.Count - 1].Cells["Id"].Value       = dr["Id"];
                dataGridFeeManage.Rows[dataGridFeeManage.Rows.Count - 1].Cells["Category"].Value = dr["Category"];
                dataGridFeeManage.Rows[dataGridFeeManage.Rows.Count - 1].Cells["Amount"].Value   = dr["Amount"];
            }
        }
Ejemplo n.º 3
0
        private void lstSemester_SelectedIndexChanged(object sender, EventArgs e)
        {
            var       SelectQuery = "Select * from Semester Where SemesterId='" + lstSemester.Text + "'";
            var       sqlData     = new lib.DatabaseConnection();
            DataTable dt          = new DataTable();

            dt = sqlData.getTable(SelectQuery);
            foreach (DataRow dr in dt.Rows)
            {
                txtSemester.Text = dr["SemesterId"].ToString();
            }

            this.btnAdd.Enabled    = false;
            this.btnDelete.Enabled = true;
        }
Ejemplo n.º 4
0
        private void BindData()
        {
            string    Data    = "SELECT * From Course";
            var       getdata = new lib.DatabaseConnection();
            DataTable dt      = new DataTable();

            dt = getdata.getTable(Data);
            foreach (DataRow dr in dt.Rows)
            {
                dataGridCourseDetails.Rows.Add();
                dataGridCourseDetails.Rows[dataGridCourseDetails.Rows.Count - 1].Cells["Id"].Value         = dr["Id"];
                dataGridCourseDetails.Rows[dataGridCourseDetails.Rows.Count - 1].Cells["CourseName"].Value = dr["CourseName"];
                dataGridCourseDetails.Rows[dataGridCourseDetails.Rows.Count - 1].Cells["Semester"].Value   = dr["Semester"];
            }
        }
Ejemplo n.º 5
0
        private void BindData(string sql)
        {
            dataAttendanceHistory.Rows.Clear();
            var getdata = new lib.DatabaseConnection();

            dt = new DataTable();
            dt = getdata.getTable(sql);
            foreach (DataRow dr in dt.Rows)
            {
                dataAttendanceHistory.Rows.Add();
                dataAttendanceHistory.Rows[dataAttendanceHistory.Rows.Count - 1].Cells["Id"].Value             = dr["Id"];
                dataAttendanceHistory.Rows[dataAttendanceHistory.Rows.Count - 1].Cells["TeacherName"].Value    = dr["TeacherName"];
                dataAttendanceHistory.Rows[dataAttendanceHistory.Rows.Count - 1].Cells["AttendanceDate"].Value = dr["AttendanceDate"];
                dataAttendanceHistory.Rows[dataAttendanceHistory.Rows.Count - 1].Cells["Attendance"].Value     = dr["Attendance"];
            }
        }
Ejemplo n.º 6
0
        private void BindData()
        {
            var       SelectQuery = "Select * From ULogin";
            var       sql         = new lib.DatabaseConnection();
            DataTable dt          = new DataTable();

            dt = sql.getTable(SelectQuery);
            foreach (DataRow dr in dt.Rows)
            {
                dataUsersView.Rows.Add();
                dataUsersView.Rows[dataUsersView.Rows.Count - 1].Cells["UserId"].Value    = dr["UserId"];
                dataUsersView.Rows[dataUsersView.Rows.Count - 1].Cells["UserName"].Value  = dr["UserName"];
                dataUsersView.Rows[dataUsersView.Rows.Count - 1].Cells["LoginName"].Value = dr["LoginName"];
                dataUsersView.Rows[dataUsersView.Rows.Count - 1].Cells["Password"].Value  = dr["Password"];
                dataUsersView.Rows[dataUsersView.Rows.Count - 1].Cells["Role"].Value      = dr["UserType"];
                dataUsersView.Rows[dataUsersView.Rows.Count - 1].Cells["Active"].Value    = dr["Active"];
            }
        }
Ejemplo n.º 7
0
        private void BindData(string sql)
        {
            dataTimeScheduleHistory.Rows.Clear();
            var getdata = new lib.DatabaseConnection();

            dt = new DataTable();
            dt = getdata.getTable(sql);
            foreach (DataRow dr in dt.Rows)
            {
                dataTimeScheduleHistory.Rows.Add();
                dataTimeScheduleHistory.Rows[dataTimeScheduleHistory.Rows.Count - 1].Cells["Id"].Value          = dr["Id"];
                dataTimeScheduleHistory.Rows[dataTimeScheduleHistory.Rows.Count - 1].Cells["TeacherName"].Value = dr["TeacherName"];
                dataTimeScheduleHistory.Rows[dataTimeScheduleHistory.Rows.Count - 1].Cells["Course"].Value      = dr["Course"];
                dataTimeScheduleHistory.Rows[dataTimeScheduleHistory.Rows.Count - 1].Cells["Semester"].Value    = dr["Semester"];
                dataTimeScheduleHistory.Rows[dataTimeScheduleHistory.Rows.Count - 1].Cells["SubjectName"].Value = dr["SubjectName"];
                dataTimeScheduleHistory.Rows[dataTimeScheduleHistory.Rows.Count - 1].Cells["Day"].Value         = dr["SDay"];
                dataTimeScheduleHistory.Rows[dataTimeScheduleHistory.Rows.Count - 1].Cells["Shift"].Value       = dr["Shift"];
                dataTimeScheduleHistory.Rows[dataTimeScheduleHistory.Rows.Count - 1].Cells["Time"].Value        = dr["STime"];
                dataTimeScheduleHistory.Rows[dataTimeScheduleHistory.Rows.Count - 1].Cells["Period"].Value      = dr["Period"];
            }
        }
Ejemplo n.º 8
0
        private void BindData()
        {
            string    Data    = "SELECT * From TeacherRegister";
            var       getdata = new lib.DatabaseConnection();
            DataTable dt      = new DataTable();

            dt = getdata.getTable(Data);
            foreach (DataRow dr in dt.Rows)
            {
                dataStaffView.Rows.Add();
                dataStaffView.Rows[dataStaffView.Rows.Count - 1].Cells["TeacherId"].Value    = dr["Id"];
                dataStaffView.Rows[dataStaffView.Rows.Count - 1].Cells["TeacherName"].Value  = dr["TeacherName"];
                dataStaffView.Rows[dataStaffView.Rows.Count - 1].Cells["Gender"].Value       = dr["Gender"];
                dataStaffView.Rows[dataStaffView.Rows.Count - 1].Cells["Address"].Value      = dr["Address"];
                dataStaffView.Rows[dataStaffView.Rows.Count - 1].Cells["RegisterDate"].Value = dr["RegisterDate"];
                dataStaffView.Rows[dataStaffView.Rows.Count - 1].Cells["PhoneNo"].Value      = dr["PhoneNo"];
                dataStaffView.Rows[dataStaffView.Rows.Count - 1].Cells["Email"].Value        = dr["Email"];
                dataStaffView.Rows[dataStaffView.Rows.Count - 1].Cells["Experience"].Value   = dr["Experience"];
                dataStaffView.Rows[dataStaffView.Rows.Count - 1].Cells["Photo"].Value        = dr["TPhoto"];
            }
        }
Ejemplo n.º 9
0
 private void LoadDatabase()
 {
     try
     {
         var       selectQuery = "SELECT * FROM sys.databases";
         var       sql         = new lib.DatabaseConnection();
         DataTable dt          = new DataTable();
         dt = sql.getTable(selectQuery);
         foreach (DataRow dr in dt.Rows)
         {
             this.cmbDatabaseName.Items.Add(dr["Name"]);
         }
     }
     catch (SqlException sqlException)
     {
         MessageBox.Show(sqlException.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }