Как восстановить данные, связанные с сохраненным шаблоном отпечатков пальцев? - PullRequest
0 голосов
/ 29 сентября 2019

Привет. Итак, я пытаюсь получить данные, прикрепленные (имя, фамилия и отдел) к отпечатку пальца, который я сохранил как LongBlob в моей базе данных sql. Я выяснил, как проверить отпечаток пальца, если онуже зарегистрирован.

Но у меня возникли проблемы с выяснением того, как после проверки отпечатка пальца в текстовых полях отображаются данные, связанные с ним (имя, фамилия и отдел).

Я использовал One Touch Sdk и цифровой сканер Persona 4500

Private Sub Process_Verify(ByVal Sample As DPFP.Sample)
    MysqlConn = New MySqlConnection
    MysqlConn.ConnectionString = "server=localhost;userid=root;password=root;database=fingerprints"
    Try

        MysqlConn.Open()
        Dim Query As String
        Query = ""
    Catch ex As Exception

    End Try
    Try
        DrawPicture(ConvertSampleToBitmap(Sample))
        Dim Features_Verify As DPFP.FeatureSet = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification)
        Dim Verificator As New DPFP.Verification.Verification
        Dim result As New DPFP.Verification.Verification.Result()


        If Not Features_Verify Is Nothing Then 'Check Fingerprint if its Registered'
            Dim sda As New MySqlDataAdapter("Select template from fingerprinttemplate", MysqlConn)


            Dim dt As New DataTable
            sda.Fill(dt)
            For Each dr As DataRow In dt.Rows
                Dim bytes As Byte() = Nothing
                bytes = dr.Item("template")

                Dim saved_temp As New DPFP.Template
                saved_temp.DeSerialize(bytes)
                Verificator.Verify(Features_Verify, saved_temp, result)
            Next
            If result.Verified Then `If Scanned Finger Is Registered Do This`
                Dim retver As New MySqlCommand("Select `FirstName`,`LastName`,`Department` from fingerprinttemplate where template = @id ", MysqlConn)
                With retver.Parameters.AddWithValue("id", Verificator)
                End With
                retver.ExecuteNonQuery()
                Dim info As New MySqlDataAdapter(retver)
                Dim infodt As New DataTable
                info.Fill(infodt)
                If infodt.Rows.Count() > 0 Then

                    FnBox.Text = infodt.Rows(0)(1).ToString()
                    LnBox.Text = infodt.Rows(0)(2).ToString
                    DpBox.Text = infodt.Rows(0)(2).ToString
                Else
                    MessageBox.Show("NO Data Found")
                End If
                MakeReport("Verified") `Prints Verified on A textbox`
                SetStatus("Verified")  `Sets a Label Status To Verified`
            Else
                MakeReport("NOT Verified")
                SetStatus("NOT Verified")
            End If
        End If
    Catch ex As Exception
        MsgBox(ex.Message)
    End Try
End Sub

Я не слишком хорошо с Sql, поэтому я думаю, что моя проблема заключается в запросе на получение прикрепленных данных.

...