Ver Mensaje Individual
  #13  
Antiguo 14-07-2011
amerika111 amerika111 is offline
Miembro
 
Registrado: nov 2009
Posts: 168
Reputación: 0
amerika111 cantidad desconocida en este momento
Cita:
Empezado por Casimiro Notevi Ver Mensaje
je, je... mi vista no da para leer eso

De todas formas te preguntaba por el código que usas para guardar los documentos.
disculpa si sorry esta muy pequeña la imagen... el codigo lo tengo en c#.net

Código:
HttpPostedFile ImgFile = ImagenFile.PostedFile;
            // Almacenamos la imagen en una variable para insertarla en la bbdd.
            Byte[] byteImage = new Byte[ImagenFile.PostedFile.ContentLength];
            ImgFile.InputStream.Read(byteImage, 0, ImagenFile.PostedFile.ContentLength);
            string sql = "insert into A_DOC_EMPLEADOS(NOEMPLEADO,DOCUMENTOS,USUARIOCREADOR)";
            sql += " Values(@NOEMPLEADO,@DOCUMENTOS,@USUARIOCREADOR)";
            string connectionString = @"User=SYSDBA;Password=masterkey;Database=C:\Archivos de programa\Sistema Bioreg\DB\BIOREGF.FDB;DataSource=192.168.1.50; Port=3050;Dialect=3; Charset=NONE;Role=;Connection lifetime=15;Pooling=true; MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;";
            FbConnection SqlConn = new FbConnection(connectionString);
            FbCommand SqlCom = new FbCommand(sql, SqlConn);
            SqlCom.Parameters.Add("NOEMPLEADO", FbDbType.VarChar, 50);
            SqlCom.Parameters["@NOEMPLEADO"].Value = txtTitulo.Text;
            SqlCom.Parameters.Add("USUARIOCREADOR", FbDbType.VarChar, 50);
            SqlCom.Parameters["@USUARIOCREADOR"].Value = lblusuario.Text;
            SqlCom.Parameters.Add("@DOCUMENTOS", FbDbType.Binary);
            SqlCom.Parameters["@DOCUMENTOS"].Value = byteImage;
            SqlConn.Open();
            int foto = SqlCom.ExecuteNonQuery();
            SqlConn.Close();

            if (foto > 0)
            {
                Label1.Text = "Documento Almacenado Correctamente";
                txtTitulo.Text = "";
            }
            else
            {
                Label1.Text = "Documento No Almacenada";
                txtTitulo.Text = "";
            }
        }

Última edición por Casimiro Notevi fecha: 14-07-2011 a las 19:52:34.
Responder Con Cita