private void ShowProfile_Load(object sender, EventArgs e) { DataAcess da = new DataAcess(); string sql = "SELECT *FROM Registrations WHERE userName= '******'"; SqlDataReader reader = da.GetData(sql); if (reader.Read()) { Nametextbox.Text = Convert.ToString(reader["fullName"]); UNtextbox.Text = Convert.ToString(reader["userName"]); PasswordtextBox.Text = Convert.ToString(reader["password"]); NidregistertextBox.Text = Convert.ToString(reader["NID"]); EmailregistertextBox.Text = Convert.ToString(reader["emailId"]); MobilenumbertextBox.Text = Convert.ToString(reader["mobileNumber"]); DOBBOX.Text = Convert.ToString(reader["dateofbirth"]); textBoxgender.Text = Convert.ToString(reader["gender"]); textBoxdivision.Text = Convert.ToString(reader["Division"]); textBox4.Text = Convert.ToString(reader["City"]); AddresText.Text = Convert.ToString(reader["Address"]); textBox5.Text = Convert.ToString(reader["category"]); textBox6.Text = Convert.ToString(reader["Profession"]); textBox7.Text = Convert.ToString(reader["bloodGroup"]); //textBoxName.Text = Convert.ToString(reader["fullName"]); //textBoxEmail.Text = Convert.ToString(reader["emailId"]); //textBoxPass.Text = Convert.ToString(reader["password"]); //Textboxgender.Text = Convert.ToString(reader["gender"]); da.ConnectionClose(); } da.ConnectionClose(); }
private void ChangePass_Load(object sender, EventArgs e) { DataAcess da = new DataAcess(); string sql = "SELECT *FROM Registrations WHERE userName= '******'"; SqlDataReader reader = da.GetData(sql); if (reader.Read()) { NameregistertextBox.Text = Convert.ToString(reader["fullName"]); UsernameregistertextBox.Text = Convert.ToString(reader["userName"]); da.ConnectionClose(); } da.ConnectionClose(); }
private void ACServicing_Load(object sender, EventArgs e) { string sql = "SELECT *FROM Registrations WHERE userName='******'"; AccessProperty ap = new AccessProperty(); DataAcess da = new DataAcess(); SqlDataReader reader = da.GetData(sql); while (reader.Read()) { textBoxCity.Text = Convert.ToString(reader["City"]); } da.ConnectionClose(); }
private void MaidService_Load(object sender, EventArgs e) { string sql = "SELECT *FROM Registrations WHERE userName='******'"; AccessProperty ap = new AccessProperty(); DataAcess da = new DataAcess(); SqlDataReader reader = da.GetData(sql); while (reader.Read()) { textBox1.Text = Convert.ToString(reader["City"]); GeneralOperations go = new GeneralOperations(); dataGridView1.DataSource = go.GetMaid(); } da.ConnectionClose(); }
private void button1_Click(object sender, EventArgs e) { SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBconnection"].ConnectionString); connection.Open(); string PF = "AC Mechanic"; string sql1 = "SELECT *FROM Registrations WHERE gender= '" + comboBox1.Text + "' and Profession='" + PF + "' "; SqlCommand command = new SqlCommand(sql1, connection); SqlDataReader reader = command.ExecuteReader(); if (reader.Read()) { connection.Close(); DataAcess ac = new DataAcess(); string sql = "SELECT *FROM Registrations WHERE City='" + textBoxCity.Text + "'AND gender='" + comboBox1.Text + "'AND Profession='" + PF + "'"; sqladp = new SqlDataAdapter(sql, connection); sqladp.Fill(data); pos = 0; displaytext(pos); ac.ConnectionClose(); connection.Close(); } else { MessageBox.Show("Sorry!There is no Mechanic as per your Requirement"); CarServicing carServicing = new CarServicing(); this.Hide(); carServicing.Show(); connection.Close(); } connection.Close(); }