Post by nosheen on Apr 13, 2013 3:07:10 GMT -4
How can i convert the blob image into a byte[] and then compare it to another byte[] to allow going into next form in c#?? Please help me i have to submit my final year project this coming week..
OracleCommand oraclecmd;
byte[] Template;
// byte[] buffer = null;
byte[] byteArray;
OracleBlob BLOB;
public void verify()
{
Template = VerifyFinger.temp;
OracleConnection con = new OracleConnection("Data Source=NOSHEEN-HP;User ID=FINAL;Password=database");
con.Open();
OracleCommand oraclecmd = new OracleCommand("Select * from REGISTRATION where TEMPLATE = :Template", con);
OracleParameter p1 = new OracleParameter();
p1.ParameterName = "Template";
oraclecmd.Parameters.Add(p1);
try
{
DataTable table = new DataTable();
OracleDataAdapter adapter = new OracleDataAdapter(oraclecmd);
OracleCommandBuilder builder = new OracleCommandBuilder(adapter);
// DataSet dataset = new DataSet();
// adapter.Fill(table);
//dataGridView1.DataSource = table;
//dataGridView1.Refresh();
OracleDataReader
dr = oraclecmd.ExecuteReader();
OracleBlob BLOB = dr.GetOracleBlob(0);
// OracleLob BLOB = dr.GetOracleLob(1);
while (dr.Read())
{
BLOB.Read(byteArray, 0 , (int)BLOB.Length);
if(two templates match)
{
{
VoteCasting vc = new VoteCasting();
vc.ShowDialog();
}
}
}
oraclecmd.Dispose();
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Exception Caught");
}
}
}