private void HomeMenuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            homemenufrm homemenufrm = new homemenufrm();

            homemenufrm.Show();
            this.Close();
        }
        private void Loginbtn_Click(object sender, EventArgs e)
        {
            //Database connection and search query for user login credintials.
            SqlConnection  con = new SqlConnection(@"Data Source=DESKTOP-H7S5UDN\SQLEXPRESS;Initial Catalog=crs;Integrated Security=True;");
            SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM [user] WHERE user_id LIKE '" + user_idTextBox.Text + "' AND password LIKE '" + passwordTextBox.Text + "' COLLATE SQL_Latin1_General_CP1_CS_AS", con);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);

            if (dt.Rows.Count == 1)
            {
                Search();
                MessageBox.Show("Login successfull", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //Opens home menu and hides the login form.
                this.Visible = false;
                homemenufrm homemenu = new homemenufrm();
                homemenu.Show();
            }
            else
            {
                //Error message for a failed login.
                MessageBox.Show("Invalid login, please check username and password.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                user_idTextBox.Clear();
                passwordTextBox.Clear();
                user_idTextBox.Focus();
            }
            con.Close();
        }