Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String^ conecto = L"datasource=localhost;port=3306;username=root;password=jeferson";
- MySqlConnection^ conDataBase = gcnew MySqlConnection(conecto);
- MySqlCommand^ cmdDataBase = gcnew MySqlCommand("insert into proyecto_bd.emp_nuevo (emp_id,emp_nombre,emp_apellido,emp_direccion,emp_dpi,emp_telefono,emp_puesto,emp_fechaing,emp_salli,emp_saltot) values('" + this->textBox6->Text + "','" + this->textBox1->Text + "','" + this->textBox2->Text + "','" + this->textBox3->Text + "','" + this->textBox4->Text + "','" + this->textBox5->Text + "','" + this->comboBox1->Text + "','" + this->dateTimePicker1->Text + "','" + this->textBox7->Text + "','" + this->label10->Text + "') ;", conDataBase);
- MySqlDataReader^ Lectura;
- try{
- conDataBase->Open();
- Lectura = cmdDataBase->ExecuteReader();
- MessageBox::Show("Registro guardado correctamente... :D", "En hora buena!", MessageBoxButtons::OK, MessageBoxIcon::Information);
- while (Lectura->Read())
- {
- }
- }
- catch (Exception^ex){
- MessageBox::Show(ex->Message);
- }
- conDataBase->Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement