private void getProfileData() { string conn; Connector c = new Connector(); bool x = c.testConnection(); if (x) { conn = c.getConnector(); MySqlConnection newConnection = new MySqlConnection(conn); MySqlCommand newCommand = new MySqlCommand("select * from leavedata.employee where userid='" + this.Username.Text + "';", newConnection); MySqlDataReader newReader; newConnection.Open(); newReader = newCommand.ExecuteReader(); string username = "", name = "", contact = "", address = "", city = "", postcode = ""; while (newReader.Read()) { username = newReader.GetString(0); name = newReader.GetString(1); contact = newReader.GetString(3); address = newReader.GetString(4); city = newReader.GetString(5); postcode = newReader.GetString(6); } newConnection.Close(); Profile p = new Profile(); p.setProfile(username, name, contact, address, city, postcode); this.Hide(); p.Show(); } }
private void SingupButton_Click(object sender, EventArgs e) { this.Hide(); Profile s = new Profile(); s.Show(); }
private void SingupButton_Click(object sender, EventArgs e) { this.Hide(); Profile s = new Profile(); s.Show(); }
private void getProfileData() { string conn; Connector c = new Connector(); bool x = c.testConnection(); if (x) { conn = c.getConnector(); MySqlConnection newConnection = new MySqlConnection(conn); MySqlCommand newCommand = new MySqlCommand("select * from leavedata.employee where userid='" + this.Username.Text + "';", newConnection); MySqlDataReader newReader; newConnection.Open(); newReader = newCommand.ExecuteReader(); string username = "", name = "", contact = "", address = "", city = "", postcode = ""; while (newReader.Read()) { username = newReader.GetString(0); name = newReader.GetString(1); contact = newReader.GetString(3); address = newReader.GetString(4); city = newReader.GetString(5); postcode = newReader.GetString(6); } newConnection.Close(); Profile p = new Profile(); p.setProfile(username, name, contact, address, city, postcode); this.Hide(); p.Show(); } }