Student Evaluation System In C# With Source Code

Student Evaluation System In C# With Source Code

Student Evaluation System in C# with Source Code 2021
Student Evaluation System in C# with Source Code 2021

The Student Evaluation System in C# with Source Code is developed using C# language. The main aim of this system is to reduce the amount of time spent on student evaluations so that workers can focus on more critical tasks.

A features of this Evaluation System in C# are so easy to use that even a novice can use them. Every enrolled student’s data is correct in this method, and students may compare their grades in the curriculum.

These are the following features of the system

  • Manages Student
  • Manage Grades
  • Manages Curriculum
  • Manage Users
  • Set Pre-Requites
  • Manage Courses
  • Print Curriculum in every Course
  • Print List of Student
  • Login and Logout

Student Evaluation System In C# With Source Code Steps On How To Run The Project

Student Evaluation System in C#.net free download with source code. To run this project make sure that you have Visual Studio IDE and XAMPP installed in your PC(for Windows) to run this project.

Time needed: 5 minutes.

These are the steps on how to run Student Evaluation System In C# With Source Code

  • Step 1: Download

    First, download the source code given below.
    Student_Evaluation_System_in_C#_Step_1

  • Step 2: Extract file

    Second, after you finished download the source code, extract the zip file.

    Student_Evaluation_System_in_C#_Step_2

  • Step 3: Open Xampp

    Third, open xampp and start the Apache and MySQL.

    Student_Evaluation_System_in_C#_Step_XAMPP

  • Step 4: Open browser

    Fourth, Open a browser and go to URL “http://localhost/phpmyadmin/”.
    Student_Evaluation_System_in_C#_Step_Localhost

  • Step 5: Create database

    Fifth, click on databases tab and Create database naming “tuts_dbcurriculumn”.
    Student_Evaluation_System_in_C#_Step_dbname

  • Step 6: Import

    Sixth, Click on browse file and select “tuts_dbcurriculumn.sql” file which is inside the “EvaluationSystem” folder and then click “Go“.
    Student_Evaluation_System_in_C#_Step_SQL

  • Step 7: Open Visual Studio

    Seventh, open “Visual Studio IDE”.
    Student_Evaluation_System_in_C#_Step_3

  • Step 8: Open project.

    Eighth, open project folder EvaluationSystem then open the “EvaluationSystem.sln“.
    Student_Evaluation_System_in_C#_Step_OpenFolder

  • Step 9: Open Project

    Ninth, Start the project.
    Student_Evaluation_System_in_C#_Step_Last

The Code Given Below is for Displaying Students in the Student Form

 private void frmStudent_Load(object sender, EventArgs e)
        {
            btn_New_Click(sender, e);
        }
 private void btn_New_Click(object sender, EventArgs e)
        {
            sql = "SELECT  `IdNo`, `Firstname`, `Lastname`, `MI`, `HomeAddress`, `Sex`, Course,`YearLevel`  FROM `tblstudent` s, tblcourse c WHERE s.`CourseId`=c.`CourseId`";
            SC.Load_DTG(sql, dtg_ABorrowLists);
            PictureBox1.ImageLocation = "";
            clearme();
            txt_sid.Clear();

            sql = "SELECT  CourseId, Course FROM `tblcourse`";
            SC.fiil_CBO(sql, cboCourse);
        }

The Code Given Below is for Saving New Students

private void btn_save_Click(object sender, EventArgs e)
        {

            string gender;
            if (rdio_female.Checked)
            {
                gender = "Female";
            }
            else
            {
                gender = "Male";
            } 

            if ( txt_sid.Text == "" 
              || txt_fname.Text == "" || txt_lname.Text == "" 
              || txt_mname.Text == "" || cboCourse.Text == "Select" 
              || cboYearLevel.Text == "Select")
            {

                UF.emptymessage();

            }
            else
            {
                sql = "SELECT * FROM `tblstudent` WHERE `IdNo`='" + txt_sid.Text + "'";
                maxrow =  SC.maxrow(sql);

                if(maxrow > 0)
                {
                    sql = "update  tblstudent set  `Firstname`='" + txt_fname.Text
                          + "', `Lastname`='" + txt_lname.Text + "', `MI`='" + txt_mname.Text
                          + "', `HomeAddress`='" + rch_address.Text + "', `Sex`='" + gender
                          + "', `CourseId`='" + cboCourse.SelectedValue
                          + "', `YearLevel`='" + cboYearLevel.Text
                          + "', `StudentPhoto`='" + Path.GetFileName(PictureBox1.ImageLocation) + "' where `IdNo`='" + txt_sid.Text + "'";
                    SC.Execute_CUD(sql, "error to execute query", "Data has been updated in the database");
                }
                else
                {
                    sql = "insert into tblstudent (`IdNo`, `Firstname`, `Lastname`, `MI`, `HomeAddress`, "
                        + "`Sex`, `CourseId`,YearLevel,  `StudentPhoto`) "
                        + "values ('" + txt_sid.Text + "','" + txt_fname.Text + "','" + txt_lname.Text
                        + "','" + txt_mname.Text + "','" + rch_address.Text
                        + "','" + gender + "','" + cboCourse.SelectedValue
                        + "','" + cboYearLevel.Text + "','" + Path.GetFileName(PictureBox1.ImageLocation) + "')";
                    SC.Execute_CUD(sql, "error to execute query", "New Data has been saved in the database");
                }

                sql = "SELECT * FROM `tblgrades` WHERE IdNo=" + txt_sid.Text +
                    " AND `YearLevel`='" + cboYearLevel.Text + "' AND `CourseId`=" + cboCourse.SelectedValue;
                maxrow = SC.maxrow(sql);

                if (maxrow == 0)
                {
                    sql = "SELECT * FROM `tblsubject` WHERE `CourseId`=" + cboCourse.SelectedValue;
                    SC.singleResult(sql);
                    foreach (DataRow r in SC.dt.Rows)
                    {
                        sql = "INSERT INTO `tblgrades` (`CourseId`, `IdNo`, `SubjectId`, `YearLevel`,`Sem`) " +
                            " VALUES (" + cboCourse.SelectedValue + ",'" + txt_sid.Text + "'," + r.Field<int>("SubjectId").ToString() +
                            ",'" + r.Field<string>("YearLevel") + "','" + r.Field<string>("Semester") + "')";
                        SC.Execute_Query(sql);
                    }

                }



                btn_New_Click(sender, e);

            }

             
         

        }

The Codes Given Below is the SQLconfig Class


namespace EvaluationSystem
{
    class SQLConfig
    {

        private MySqlConnection con = new MySqlConnection("server=localhost;user id=root;password=;database=tuts_dbcurriculumn;sslMode=none");
        private MySqlCommand cmd;
        private MySqlDataAdapter da;
        public DataTable dt; 
        int result;
        usableFunction funct = new usableFunction(); 
        public void Execute_CUD(string sql, string msg_false, string msg_true)
        {
            try
            {
                con.Open();
                cmd = new MySqlCommand();
                cmd.Connection = con;
                cmd.CommandText = sql;
                result = cmd.ExecuteNonQuery();

                if(result > 0)
                {
                    MessageBox.Show(msg_true);
                }
                else
                {
                    MessageBox.Show(msg_false);
                } 

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close(); 
            }
        }
        public void Execute_Query(string sql)
        {
            try
            {
                con.Open();
                cmd = new MySqlCommand();
                cmd.Connection = con;
                cmd.CommandText = sql;
                result = cmd.ExecuteNonQuery();
                 
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
            }
        }
        public void Load_DTG(string sql,DataGridView dtg)
        {
            try
            {
                //con.Open();
                if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }
                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = sql;
                da.SelectCommand = cmd;
                da.Fill(dt);
                dtg.DataSource = dt;

               
                funct.ResponsiveDtg(dtg);
                dtg.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
                dtg.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;

                
                

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                da.Dispose();
                con.Close();
            }

        }

        public void Load_ResultList(string sql, DataGridView dtg)
        {
            try
            {
                //con.Open();
                if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }
                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = sql;
                da.SelectCommand = cmd;
                da.Fill(dt);
                dtg.DataSource = dt;


                funct.ResponsiveDtg(dtg);
                dtg.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
                dtg.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;




            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                da.Dispose();
                con.Close();
            }

        }
        public void fiil_CBO(string sql, ComboBox cbo)
        {
            try
            {
                if (con.State != ConnectionState.Open)
                {
                    con.Open(); 
                } 

                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = sql;
                da.SelectCommand = cmd;
                da.Fill(dt);

                cbo.DataSource = dt;
                cbo.ValueMember = dt.Columns[0].ColumnName;
                cbo.DisplayMember = dt.Columns[1].ColumnName;


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
                da.Dispose();
            }

        }
        public void combo(string sql, ComboBox cbo)
        {
            try
            {
                if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }

                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = sql;
                da.SelectCommand = cmd;
                da.Fill(dt);

                cbo.Items.Clear();
                cbo.Text = "Select";
                foreach(DataRow r in dt.Rows)
                {
                    cbo.Items.Add(r.Field<string>(0));
                }


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
                da.Dispose();
            }

        }
        public void singleResult(string sql)

        {
            try
            {
                con.Open();
                //if (con.State == ConnectionState.Open)
                //{
                //    con.Close();
                //}
                //else
                //{
                //    con.Open(); 
                //}
                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = sql;
                da.SelectCommand = cmd;
                da.Fill(dt);  


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                da.Dispose();
                con.Close();
            }
        }
        public int maxrow(string sql)

        {
            int maxrow = 0;
            try
            {
                con.Open(); 
                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = sql;
                da.SelectCommand = cmd;
                da.Fill(dt);

                maxrow = dt.Rows.Count;


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                da.Dispose();
                con.Close();
            }
            return maxrow;
        }
        public void loadReports(string sql)

        {
            try
            {
                con.Open();
                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = sql;
                da.SelectCommand = cmd;
                da.Fill(dt);

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
                da.Dispose();
            }
        }

        public void autocomplete(string sql,TextBox txt)
        {
            try
            {
                con.Open();
                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = sql;
                da.SelectCommand = cmd;
                da.Fill(dt);

                txt.AutoCompleteCustomSource.Clear();
                txt.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
                txt.AutoCompleteSource = AutoCompleteSource.CustomSource;

                foreach (DataRow r in dt.Rows)
                {
                    txt.AutoCompleteCustomSource.Add(r.Field<string>(0));
                }


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
                da.Dispose();
            }
        }

        public void autonumber(string AUTOKEY, TextBox txt)
        {
            try
            {

                if (con.State != ConnectionState.Open)
                {
                    con.Open(); 
                }
                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = "SELECT concat(`STRT`, `END`) FROM `tblautonumber` WHERE `DESCRIPTION`='" + AUTOKEY + "'";
                da.SelectCommand = cmd;
                da.Fill(dt);

                txt.Text = DateTime.Now.ToString("yyyy") + dt.Rows[0].Field<string>(0);
            

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
                da.Dispose();
            }
        }

        public void trans_autonumber(string AUTOKEY, Label txt)
        {
            try
            {

                if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }
                cmd = new MySqlCommand();
                da = new MySqlDataAdapter();
                dt = new DataTable();


                cmd.Connection = con;
                cmd.CommandText = "SELECT concat(`STRT`, `END`) FROM `tblautonumber` WHERE `DESCRIPTION`='" + AUTOKEY + "'";
                da.SelectCommand = cmd;
                da.Fill(dt);

                txt.Text = DateTime.Now.ToString("yyyy") + dt.Rows[0].Field<string>(0);


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
                da.Dispose();
            }
        }
        public void update_Autonumber(string id)
        { 
            Execute_Query("UPDATE `tblautonumber` SET `END`=`END`+`INCREMENT` WHERE `DESCRIPTION`='" + id + "'");
        }

      
    }
}
ABOUT PROJECTPROJECT DETAILS
Project Name : Student Evaluation System
Project Platform :C#
Programming Language Used:C# Programming Language
Developer Name :itsourcecode.com
IDE Tool (Recommended):Visual Studio 2019
Project Type :Desktop Application
Database:MYSQL DATABASE
Upload Date and Time:march 9, 2021- 6:33 am

Downloadable Source Code

Username:admin Password: admin

Conclusion

This Student Evaluation System in C#.net is only a project made for school requirement purposes only. You can download this source code and modify it to suit your client requirements, since this is a student project it means you cannot really expect 100% functionality from this.

Inquiries

If you have any questions or suggestions about Student Evaluation System In C# With Source Code, please feel free to leave a comment below.

1 thought on “Student Evaluation System In C# With Source Code”

  1. Server didn’t connect in my system.Database that u create is not in my system.when I start run the project and I give username and password and click ok it would sent a message box (ie) unable to connect to any of the specific MYSQL hosts .What can I do sir!.

    Reply

Leave a Comment