private void buttonStudentSignIn_Click(object sender, EventArgs e) { var m = new SigninAsStudentMsgBox(); m.Show(); this.Hide(); }
private void Form1_Load(object sender, EventArgs e) { timer1.Start(); using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Mycon"].ConnectionString)) { try { //Set Instructor name under his pic con.Open(); SigninAsStudentMsgBox s = new SigninAsStudentMsgBox(); SqlCommand cmd = new SqlCommand("SELECT CONCAT(Ins_Fname,' ',Ins_Lname) FROM dbo.Instructor WHERE Ins_ID =" + global.InsID, con); string name = Convert.ToString(cmd.ExecuteScalar()); lblIns_ID.Text = name; } catch (Exception ex) { MessageBox.Show("Please! Contact your adminstrator", "Something went wrong!", MessageBoxButtons.OK, MessageBoxIcon.Error); //MessageBox.Show(ex.ToString()); } } }
private void Form1_Load(object sender, EventArgs e) { timer1.Start(); using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Mycon"].ConnectionString)) { try { //Set student name under his pic con.Open(); SigninAsStudentMsgBox s = new SigninAsStudentMsgBox(); SqlCommand cmd = new SqlCommand("Select Concat(St_fname,' ' ,St_lname) 'Student Name' from Student where St_ID = " + global.StudentID, con); string name = Convert.ToString(cmd.ExecuteScalar()); lblSt_name.Text = name; } catch (Exception ex) { //MessageBox.Show(ex.ToString()); MessageBox.Show("Please! Contact your adminstrator", "Something went wrong!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }