Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         FileStream   fs     = new FileStream(nombreImagen, FileMode.Open, FileAccess.Read);
         BinaryReader br     = new BinaryReader(fs);
         byte[]       bloque = br.ReadBytes((int)fs.Length);
         cnx.Insertar(txtNombre.Text, Convert.ToDouble(txtPrecio.Text), bloque, Convert.ToInt16(txtStockMin.Text), Convert.ToInt16(txtStockActual.Text));
     }
     catch (Exception)
     {
         MessageBox.Show("datos incompletos");
     }
 }