Click here to Skip to main content
16,022,332 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have saved the digital persona dpfp template in varbinary(max), now i am retireivng it from database , converting in byte[] then deserilizing it, and then putting in the verify() method, but error occcruing
Exception from HRESULT: 0xFFFFFFF8

how i am getting data is given below



SqlConnection cn = new SqlConnection(@"Data Source=Windows\me;Initial Catalog=Enroll;Persist Security Info=True;User ID=sa ; Password=sa123");

cn.Open();
SqlDataAdapter adp = new SqlDataAdapter("Select varb from employee where employeeid='127'", cn);
DataTable dt = new DataTable();
adp.Fill(dt);
bytes= ConvertDataSetToByteArray(dt);



Template = new DPFP.Template();
Template.DeSerialize(bytes);




Verificator.Verify(features, Template, ref result);
UpdateStatus(result.FARAchieved);
if (result.Verified)
MakeReport("The fingerprint was VERIFIED.");
else
MakeReport("The fingerprint was NOT VERIFIED.");
}

this Verify() is not verifying the data coming from DB>

where i am doing mistake? in conversion? or in not getting data properly?
Posted
Updated 29-Mar-19 4:15am
Comments
Member 12862705 23-Jan-17 10:12am    
hey man how to verify all fingerprint template from database ? this code is from one touch sdk enrollment sample right?

ConvertDataSetToByteArray() mehthod should be excluded

System.Byte in datable will be convert in to byte[] by:

C#
foreach (DataRow row in dt.Rows)
                   {
                        bytes = (byte[])row["varb"];
                   }
 
Share this answer
 
ConvertDataSetToByteArray does not do what you think it does.

You need to get the data table value for the field "varb" as a byte array ( see Field<t>()[^] )
 
Share this answer
 
Comments
Karachi Coder 1-Jul-15 12:24pm    
this method contains

private byte[] ConvertDataSetToByteArray(DataTable dataTable)
{
byte[] binaryDataResult = null;
using (MemoryStream memStream = new MemoryStream())
{
BinaryFormatter brFormatter = new BinaryFormatter();
dataTable.RemotingFormat = SerializationFormat.Binary;
brFormatter.Serialize(memStream, dataTable);
binaryDataResult = memStream.ToArray();
}
return binaryDataResult;
}


what to do now
Peter Sheyi 2-Sep-24 22:59pm    
will this method still work in 2024? I am having similar issue. I can register a student but verifying always return this error "An error occured: Exception from HRESULT: 0xFFFFFFF8"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900