I am having problem in the fingerprint verification using vb .net 2010. Sql statement was able to retrieve the value and was able to convert bytes to template.
error says the templa8 is not set.
error starts at Verificator.Verify(features, templa8, result)
Her is the error,
DPFP.Error.SDKException: Event Handler has generated an Exception ---> System.NullReferenceException: Object reference not set to an instance of an object.
at LDPS.frmverify.Process(Sample Sample) in D:\My FILES\C# Projects\LDPS\frmverify.vb:line 66
at LDPS.frmverify.OnComplete(Object Capture, String ReaderSerialNumber, Sample Sample) in D:\My FILES\C# Projects\LDPS\frmverify.vb:line 140
at DPFP.Capture.Capture.MessageReceived(Message& m)
--- End of inner exception stack trace ---
at DPFP.Capture.Capture.MessageReceived(Message& m)
at DPFP.Capture.Capture.MessageEvents.MessageWindow.WndProc(Message& m)
My code are as follows:
Protected Sub Process(ByVal Sample As DPFP.Sample)
DrawPicture(ConvertSampleToBitmap(Sample))
Dim features As DPFP.FeatureSet = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification)
If TextBox2.Text = String.Empty Then
MySql = "select customerid,FpTemplate1 from tblFp"
Else
MySql = "select a.customerid,b.FpTemplate1 as FpTemplate1,a.customername from tblCustomerDetails a, tblFp b WHERE a.CustomerID = b.CustomerID and CustomerName LIKE '%" & TextBox2.Text & "%'"
End If
Conn.Open()
' Try
cmd = New SqlCommand(MySql, Conn)
Dim reader As SqlDataReader = cmd.ExecuteReader()
If reader.HasRows Then
While reader.Read()
Dim MemStream As IO.MemoryStream
Dim fpBytes As Byte()
fpBytes = reader(1)
MemStream = New IO.MemoryStream(fpBytes)
Dim templa8 As DPFP.Template = New DPFP.Template()
templa8.DeSerialize(MemStream)
Me.Template = templa8
' Check quality of the sample and start verification if it's good
If Not features Is Nothing Then
' Compare the feature set with our template
Dim result As DPFP.Verification.Verification.Result = New DPFP.Verification.Verification.Result()
Verificator.Verify(features, templa8, result)
If result.Verified Then
Dim comments As String = "This Fingerprint is owned by " & reader(0).ToString
MessageBox.Show(comments)
Exit Sub
Else
MessageBox.Show("The fingerprint was NOT VERIFIED!")
End If
Else
MessageBox.Show("Fingerprint sample is not established!")
End If
End While
Else
MessageBox.Show("No record found!")
End If
cmd.ExecuteNonQuery()
' Catch ex As Exception
' MessageBox.Show(ex.Message, "Verification Error")
' End Try
Conn.Close()
End Sub
Please help