private void Insert() { try { if (tarjetaname.Text.Trim().Length == 0) { MessageBox.Show("Ingrese nombre de Tarjeta", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { tb_t1_tarjetaBL BL = new tb_t1_tarjetaBL(); tb_t1_tarjeta BE = new tb_t1_tarjeta(); BE.tarjetaname = tarjetaname.Text.ToUpper(); System.IO.MemoryStream ms = new System.IO.MemoryStream(); if (go_foto.Image != null) { go_foto.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); } BE.tarjetalogo = ms.GetBuffer(); if (BL.Insert(EmpresaID, BE)) { MessageBox.Show("Datos Grabados Correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information); procesado = true; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }