Click here to Skip to main content
15,885,201 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi to all,
Here i want to connect biometric database to our application sql database for fetching data.
My devices is identix k30 model.
Here i need to fetch data from biometric databse to my web application.actually i established connection.
using below code:-
C#
zkemkeeper.CZKEMClass axczkem1 = new zkemkeeper.CZKEMClass();
           bool bIsConnected = false;
           string ip = "192.168.1.10";//write here IP Address of your biomatric m/c
           int port = 4370;
           bIsConnected = axczkem1.Connect_Net(ip, port);

           if (bIsConnected == true)
           {
               MessageBox.Show("Connection established!!!");
           }


for above code connection established.how to do fetch database.

What I have tried:

i established connection but i don't have any idea how to connect that database.
Posted
Updated 14-Mar-16 8:10am
Comments
VR Karthikeyan 14-Mar-16 2:49am    
Do not repost.
JOTHI KUMAR Member 10918227 14-Mar-16 3:12am    
sorry ? what??

1 solution

Here is come code that I found on StackOverflow, you need a ListView on your form named "lvLogs" to be able to use it:

C#
//Download the attendance records from the device(For both Black&White and TFT screen devices).
private void btnGetGeneralLogData_Click(object sender, EventArgs e)
{
    if (bIsConnected == false)
    {
        MessageBox.Show("Please connect the device first", "Error");
        return;
    }

    string sdwEnrollNumber = "";
    int idwTMachineNumber=0;
    int idwEMachineNumber=0;
    int idwVerifyMode=0;
    int idwInOutMode=0;
    int idwYear=0;
    int idwMonth=0;
    int idwDay=0;
    int idwHour=0;
    int idwMinute=0;
    int idwSecond = 0;
    int idwWorkcode = 0;

    int idwErrorCode=0;
    int iGLCount = 0;
    int iIndex = 0;

    Cursor = Cursors.WaitCursor;
    lvLogs.Items.Clear();
    axCZKEM1.EnableDevice(iMachineNumber, false);//disable the device
    if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read all the attendance records to the memory

    {
        while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, out sdwEnrollNumber, out idwVerifyMode,
                   out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkcode))//get records from the memory
        {
            iGLCount++;
            lvLogs.Items.Add(iGLCount.ToString());
            lvLogs.Items[iIndex].SubItems.Add(sdwEnrollNumber);//modify by Darcy on Nov.26 2009
            lvLogs.Items[iIndex].SubItems.Add(idwVerifyMode.ToString());
            lvLogs.Items[iIndex].SubItems.Add(idwInOutMode.ToString());
            lvLogs.Items[iIndex].SubItems.Add(idwYear.ToString() + "-" + idwMonth.ToString() + "-" + idwDay.ToString() + " " + idwHour.ToString() + ":" + idwMinute.ToString() + ":" + idwSecond.ToString());
            lvLogs.Items[iIndex].SubItems.Add(idwWorkcode.ToString());
            iIndex++;
        }
    }
    else
    {
        Cursor = Cursors.Default;
        axCZKEM1.GetLastError(ref idwErrorCode);

        if (idwErrorCode != 0)
        {
            MessageBox.Show("Reading data from terminal failed,ErrorCode: " + idwErrorCode.ToString(),"Error");
        }
        else
        {
            MessageBox.Show("No data from terminal returns!","Error");
        }
    }
    axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device
    Cursor = Cursors.Default;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900