0

I'm very new to this fingerprint thing on vb.net and mysql. I just started trying to use the digitalpersona u.are.u 4500 and I don't know how to save template to Mysql database. I also want to retrieve the data from Mysql. Here is the code. Thank you! `

Private Enroller As DPFP.Processing.Enrollment

Protected Overrides Sub Init()
    MyBase.Init()
    MyBase.Text = "Fingerprint Enrollment"
    Enroller = New DPFP.Processing.Enrollment()     ' Create an enrollment.
    UpdateStatus()
End Sub

Protected Overrides Sub Process(ByVal Sample As DPFP.Sample)
    MyBase.Process(Sample)

    ' Process the sample and create a feature set for the enrollment purpose.
    Dim features As DPFP.FeatureSet = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment)

    ' Check quality of the sample and add to enroller if it's good
    If (Not features Is Nothing) Then
        Try
            MakeReport("The fingerprint feature set was created.")
            Enroller.AddFeatures(features)        ' Add feature set to template.
        Finally
            UpdateStatus()

            ' Check if template has been created.
            Select Case Enroller.TemplateStatus
                Case DPFP.Processing.Enrollment.Status.Ready    ' Report success and stop capturing
                    RaiseEvent OnTemplate(Enroller.Template)
                    SetPrompt("Click Close, and then click Fingerprint Verification.")
                    StopCapture()

                Case DPFP.Processing.Enrollment.Status.Failed   ' Report failure and restart capturing
                    Enroller.Clear()
                    StopCapture()
                    RaiseEvent OnTemplate(Nothing)
                    StartCapture()

            End Select
        End Try
    End If
End Sub

Protected Sub UpdateStatus()
    ' Show number of samples needed.
    SetStatus(String.Format("Fingerprint samples needed: {0}", Enroller.FeaturesNeeded))
End Sub

Private Sub EnrollmentForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

End Sub
Private Sub InitializeComponent()
    Me.SuspendLayout()
    '
    'bioenrollment
    '
    Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
    Me.ClientSize = New System.Drawing.Size(1266, 630)
    Me.Name = "bioenrollment"
    Me.ResumeLayout(False)
    Me.PerformLayout()

End Sub`
5
  • That's oracle bro. I'm using vb.net. Thanks! Jan 27, 2016 at 19:02
  • It's the same concept. If the template is a string you insert as you would any string. Oracle is a database. VB.NET is a language. And it looks like they are using a .NET language in the question.
    – johnny
    Jan 27, 2016 at 19:03
  • problem is I dont know how to do that. sorry, newbie here. Jan 27, 2016 at 19:48
  • I voted to close because the question is too broad. There are many, many questions and answers on SO on how to insert data into a MySQL database. Don't take it wrong. I think you should just understand that if your only question is how to insert data into a MySQL database, there are multiple ways to do so explained across many SO questions. Search for Insert data into a MySQL database. If that does not answer, you will be able to better articulate a more exact question.
    – johnny
    Jan 27, 2016 at 20:00

2 Answers 2

0

The DigitalPersona Fingerprint Reader will allow you to serialize the fingerprint to an XML file......you just store this in the database as a Varchar(MAX).

1
  • problem is I dont know how to do that. sorry, newbie here. Jan 27, 2016 at 19:48
0

Try this code for insert

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    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 SQLconnect As New SQLite.SQLiteConnection()
    Dim SQLcommand As SQLiteCommand
    SQLconnect.ConnectionString = "data source=C:\Users\mypc\Documents\MatrixDbase.s3db"
    SQLconnect.Open()
    SQLcommand = SQLconnect.CreateCommand

    SQLcommand.CommandText = "INSERT INTO Longin (id, Fname, Lname, Pic) VALUES ('" & TextBox1.Text & "', '" & TextBox2.Text & "', '" & TextBox3.Text & "', @Pic)"

    SQLcommand.Parameters.AddWithValue("@Pic", bytes)
    'Runs Query
    SQLcommand.ExecuteNonQuery()
    SQLcommand.Dispose()
    SQLconnect.Close()

End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.