private void button_registrar_Click(object sender, EventArgs e) { conexion con = new conexion(); string nom = text_nombre.Text; string ape=text_apellido.Text; string cor = text_correo.Text + "@" + combobox_correo.Text; string user=text_user.Text; string pas=text_pasword.Text; string nac=dateTimePicker1.Text; string tel = text_telefono.Text; string sex=combobox_sexo.SelectedItem.ToString(); Boolean estado = false; con.inserta_user(nom, ape, cor, user, pas, nac, tel, sex); }
private void button1_Click(object sender, EventArgs e) { conexion con = new conexion(); Boolean estado = false; estado = con.consulta_log(text_user.Text, text_pas.Text); if (estado == true) { Ventana frm = new Ventana(); frm.Show(); this.Hide(); } else { MessageBox.Show("Error de servidor"); } }
public void inserta_user(string nom, string ape, string cor, string user,string pas,string nac,string tel,string sex) { conecta(); conexion con = new conexion(); int cod = con.count(); MySqlCommand cmd = new MySqlCommand(); <<<<<<< HEAD string strSQL = "insert into usuario values(" + 3 + ",'" + nom + "','" + ape + "','" + cor + "','" + user + "','" + pas + "','" + nac + "','" + tel + "','" + sex + "');"; ======= string strSQL = "insert into usuario values(" + cod + ",'" + nom + "','" + ape + "','" + cor + "','" + user + "','" + pas + "','" + nac + "','" + tel + "','" + sex + "');"; >>>>>>> origin/Olivia-Perez cmd.CommandText = strSQL; cmd.Connection = connection; cmd.ExecuteNonQuery(); }