// https://www.daniweb.com/software-development/vbnet/threads/472214/how-to-match-a-fingerprint-template-from-database-
Dim fingerprintData As MemoryStream = New MemoryStream
Template.Serialize(fingerprintData)
fingerprintData.Position = 0
Dim br As BinaryReader = New BinaryReader(fingerprintData)
Dim bytes() As Byte = br.ReadBytes(CType(fingerprintData.Length, Int32))
Dim cmd As SqlCommand = New SqlCommand("INSERT INTO fininger_table VALUES(@FIRSTNAME, @LASTNAME, @FINGERPRINT)", conn)
cmd.Parameters.Add("FIRSTNAME", SqlDbType.VarChar).Value = CaptureForm.tboxFname.Text
cmd.Parameters.Add("LASTNAME", SqlDbType.VarChar).Value = CaptureForm.tboxLname.Text
cmd.Parameters.Add("FINGERPRINT", SqlDbType.Image).Value = bytes
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
conn.Open()
Dim cmd As New SqlCommand("SELECT * FROM Fininger_table", conn)
Dim rdr As SqlDataReader = cmd.ExecuteReader()
Dim MemStream As IO.MemoryStream
Dim fpBytes As Byte()
While rdr.Read()
fpBytes = rdr("FINGERPRINT")
MemStream = New IO.MemoryStream(fpBytes)
Dim template As New DPFP.Template(MemStream)
OnTemplate(template)
' template.DeSerialize(MemStream)
End While
rdr.Close()
conn.Close()