Advertisement
SrJefers_Loading

ingreso de datos

Jun 7th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. String^ conecto = L"datasource=localhost;port=3306;username=root;password=jeferson";
  2. MySqlConnection^ conDataBase = gcnew MySqlConnection(conecto);
  3. 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);
  4. MySqlDataReader^ Lectura;
  5. try{
  6. conDataBase->Open();
  7. Lectura = cmdDataBase->ExecuteReader();
  8. MessageBox::Show("Registro guardado correctamente... :D", "En hora buena!", MessageBoxButtons::OK, MessageBoxIcon::Information);
  9. while (Lectura->Read())
  10. {
  11.  
  12. }
  13. }
  14. catch (Exception^ex){
  15.  
  16. MessageBox::Show(ex->Message);
  17. }
  18.  
  19. conDataBase->Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement