private void cmdGetAllEnrollData_Click(object sender, EventArgs e)
        {
            int     vEnrollNumber   = 0;
            int     vEMachineNumber = 0;
            int     vFingerNumber   = 0;
            int     vPrivilege      = 0;
            int     vEnable         = 0;
            Boolean vFlag;
            Boolean vRet;
            int     vMsgRet;
            int     vErrorCode = 0;
            string  vStr       = "";
            int     i;
            string  vTitle;

            DataTable dbEnrollTble;
            DataRow   dbRow;
            DataSet   dsChange;

            GCHandle gh;

            lstEnrollData.Items.Clear();
            vTitle          = this.Text;
            Label2.Text     = "";
            lblMessage.Text = "Working...";
            Application.DoEvents();

            vRet = bpc.EnableDevice(Program.gMachineNumber, 0); // 0 : false
            if (!vRet)
            {
                lblMessage.Text = util.gstrNoDevice;
                return;
            }

            vRet = bpc.ReadAllUserID(Program.gMachineNumber);
            if (vRet)
            {
                lblMessage.Text = "ReadAllUserID OK";
            }
            else
            {
                bpc.GetLastError(ref vErrorCode);
                lblMessage.Text = util.ErrorPrint(vErrorCode);
                bpc.EnableDevice(Program.gMachineNumber, 1); // 1 : true
                return;
            }

            //*'*/---- Get Enroll data and save into database -------------
            Cursor = System.Windows.Forms.Cursors.WaitCursor;
            vFlag  = false;


            dbEnrollTble = dsEnrolls.Tables[0];

            //            gGetState = true;

            while (true)
            {
                vRet = bpc.GetAllUserID(Program.gMachineNumber, ref vEnrollNumber, ref vEMachineNumber, ref vFingerNumber, ref vPrivilege, ref vEnable);
                if (!vRet)
                {
                    break;
                }
                vFlag = true;
EEE:
                if (vFingerNumber >= 50)
                {
                    continue;
                }

                gh = GCHandle.Alloc(gTemplngEnrollData, GCHandleType.Pinned);
                IntPtr AddrOfTemplngEnrollData = gh.AddrOfPinnedObject();
                int    nAddr = AddrOfTemplngEnrollData.ToInt32();

                vRet = bpc.GetEnrollData1(Program.gMachineNumber, vEnrollNumber, vFingerNumber, ref vPrivilege, ref nAddr, ref glngEnrollPData);

                if (!vRet)
                {
                    vFlag = false;
                    vStr  = "GetEnrollData";
                    bpc.GetLastError(ref vErrorCode);
                    vMsgRet = util.MessageBox(new IntPtr(0), util.ErrorPrint(vErrorCode) + ": Continue ?", "GetEnrollData", 4);
                    if (vMsgRet == 6 /*MsgBoxResult.Yes*/)
                    {
                        goto EEE;
                    }
                    else if (vMsgRet == 7 /*MsgBoxResult.Cancel*/)
                    {
                        Cursor = System.Windows.Forms.Cursors.Default;
                        bpc.EnableDevice(Program.gMachineNumber, 1); // 1 : true
                        //                        gGetState = false;
                        return;
                    }
                }
                foreach (DataRow dbRow1 in dbEnrollTble.Rows)
                {
                    if ((int)dbRow1["EnrollNumber"] == vEnrollNumber)
                    {
                        if ((int)dbRow1["EMachineNumber"] == vEMachineNumber)
                        {
                            if ((int)dbRow1["FingerNumber"] == vFingerNumber)
                            {
                                lblMessage.Text = "Double ID";
                                goto FFF;
                            }
                        }
                    }
                }

                dbRow = dbEnrollTble.NewRow();
                dbRow["EMachineNumber"] = vEMachineNumber;
                dbRow["EnrollNumber"]   = vEnrollNumber;
                dbRow["FingerNumber"]   = vFingerNumber;
                dbRow["Privilige"]      = vPrivilege;

                if (vFingerNumber == 10)
                {
                    dbRow["Password1"] = glngEnrollPData;
                }
                else if (vFingerNumber == 15)
                {
                    dbRow["Password1"] = glngEnrollPData;
                }
                else if (vFingerNumber == 11)
                {
                    dbRow["Password1"] = glngEnrollPData;
                }
                else
                {
                    dbRow["Password1"] = 0;

                    for (i = 0; i < DATASIZE; i++)
                    {
                        gbytEnrollData[i * 5] = 1;
                        if (gTemplngEnrollData[i] < 0)
                        {
                            gbytEnrollData[i * 5] = 0;
                            gTemplngEnrollData[i] = System.Math.Abs(gTemplngEnrollData[i]);
                        }
                        gbytEnrollData[i * 5 + 1] = (Byte)(gTemplngEnrollData[i] / 256 / 256 / 256);
                        gbytEnrollData[i * 5 + 2] = (Byte)((gTemplngEnrollData[i] / 256 / 256) % 256);
                        gbytEnrollData[i * 5 + 3] = (Byte)((gTemplngEnrollData[i] / 256) % 256);
                        gbytEnrollData[i * 5 + 4] = (Byte)(gTemplngEnrollData[i] % 256);
                    }

                    //dbRow("FPdata") = gbytEnrollData        '<---------- Error

                    Byte[] gbyt = new Byte[DATASIZE * 5];
                    for (i = 0; i < DATASIZE * 5; i++)
                    {
                        gbyt[i] = gbytEnrollData[i];
                    }
                    dbRow["FPdata"] = gbyt;
                }
                dbEnrollTble.Rows.Add(dbRow);

FFF:

                lblMessage.Text        = String.Format("{0:D2}", vEMachineNumber) + "-" + String.Format("{0:D2}", vEnrollNumber) + "-" + vFingerNumber;
                this.Text              = String.Format("{0:D2}", vEnrollNumber);
                txtEnrollNumber.Text   = Convert.ToString(vEnrollNumber);
                cmbBackupNumber.Text   = Convert.ToString(vFingerNumber);
                cmbEMachineNumber.Text = Convert.ToString(vEMachineNumber);
                cmbPrivilege.Text      = Convert.ToString(vPrivilege);
                Application.DoEvents();
            }

            Label2.Text = "Total : " + dsEnrolls.Tables["tblEnroll"].Rows.Count;
            dsChange    = dsEnrolls.GetChanges();
            EnrollData.DataModule.SaveEnrolls(dsEnrolls);

            //            gh.Free();


            //            gGetState = false;

            vTitle = this.Text;
            Cursor = System.Windows.Forms.Cursors.Default;

            if (vFlag)
            {
                lblMessage.Text = "GetAllUserID OK";
            }
            else
            {
                lblMessage.Text = vStr + ":" + util.ErrorPrint(vErrorCode);
            }

            Application.DoEvents();
            bpc.EnableDevice(Program.gMachineNumber, 1); // 1 : true
        }