vb.net - VB .net Fingerprint Verification -- Object reference not set to an instance of an object -
i having problem in fingerprint verification using vb .net 2010. sql statement able retrieve value , able convert bytes template.
error says templa8 not set.
error starts @ verificator.verify(features, templa8, result)
her error,
dpfp.error.sdkexception: event handler has generated exception ---> system.nullreferenceexception: object reference not set instance of object. @ ldps.frmverify.process(sample sample) in d:\my files\c# projects\ldps\frmverify.vb:line 66 @ ldps.frmverify.oncomplete(object capture, string readerserialnumber, sample sample) in d:\my files\c# projects\ldps\frmverify.vb:line 140 @ dpfp.capture.capture.messagereceived(message& m) --- end of inner exception stack trace --- @ dpfp.capture.capture.messagereceived(message& m) @ dpfp.capture.capture.messageevents.messagewindow.wndproc(message& m)
my code follows:
protected sub process(byval sample dpfp.sample) drawpicture(convertsampletobitmap(sample)) dim features dpfp.featureset = extractfeatures(sample, dpfp.processing.datapurpose.verification) if textbox2.text = string.empty mysql = "select customerid,fptemplate1 tblfp" else mysql = "select a.customerid,b.fptemplate1 fptemplate1,a.customername tblcustomerdetails a, tblfp b a.customerid = b.customerid , customername '%" & textbox2.text & "%'" end if conn.open() ' try cmd = new sqlcommand(mysql, conn) dim reader sqldatareader = cmd.executereader() if reader.hasrows while reader.read() dim memstream io.memorystream dim fpbytes byte() fpbytes = reader(1) memstream = new io.memorystream(fpbytes) dim templa8 dpfp.template = new dpfp.template() templa8.deserialize(memstream) me.template = templa8 ' check quality of sample , start verification if it's if not features nothing ' compare feature set our template dim result dpfp.verification.verification.result = new dpfp.verification.verification.result() verificator.verify(features, templa8, result) if result.verified dim comments string = "this fingerprint owned " & reader(0).tostring messagebox.show(comments) exit sub else messagebox.show("the fingerprint not verified!") end if else messagebox.show("fingerprint sample not established!") end if end while else messagebox.show("no record found!") end if cmd.executenonquery() ' catch ex exception ' messagebox.show(ex.message, "verification error") ' end try conn.close() end sub
please help
problem solved. system works fine now. have added following code.
public event ontemplate(byval templa8)
Comments
Post a Comment