Oracle
 sql >> Datenbank >  >> RDS >> Oracle

So verschieben Sie die Fingerabdruckvorlage in die Oracle-Datenbank

                   string path="C:\\Fingerprintimage.bmp";
                    FileStream fls;
                    fls = new FileStream(path, FileMode.Open, FileAccess.Read);
                    byte[]  blob = new byte[fls.Length];
                    fls.Read(blob, 0, System.Convert.ToInt32(fls.Length));
                    fls.Close();
                    string q="";
                    q = "insert into mytable(ID,FINGERPRINT) values(" + 1 + ", :BlobParameter)";
                    OracleParameter blobParameter = new OracleParameter();
                    blobParameter.OracleDbType = OracleDbType.Blob;
                    blobParameter.ParameterName = "BlobParameter";
                    blobParameter.Value = blob;
                    cmd = new OracleCommand(q, conn);
                    cmd.Parameters.Add(blobParameter);
                    cmd.ExecuteNonQuery();