it's my first time here just to ask some questions I couldn't seem to find the answer to. Basically, I created a system that would accept fingerprint of a person and will login him/her into the system. But as time goes on, I have thousands of record and the fingerprint searching has become much slower than it used to.
The basic process of what I do is that I select all the biometrics data from a table and in my code, I use a foreach loop to go through one by one as the fingerprint template compare it to teach until it gets the right one.
Can you give some tips to make my selection much faster? Any help would be appreciated.
using (conn = new SqlConnection(connString)) {
conn.Open();
using (comm = new SqlCommand("EXEC dbn.sp_opd_selectBiometrics", conn)) {
using (adap = new SqlDataAdapter(comm)) {
using (dt = new DataTable()) {
adap.Fill(dt);
if (dt.Rows.Count > 0) {
foreach (DataRow dr in dt.Rows) {
//Deserialize fingerprint template to bytes for verification
try {
byte[] _img = (byte[])dr["biometrics"];
string byteBiometrics = Encoding.UTF8.GetString(_img, 0, _img.Length);
getHcode = (string)dr["hpercode"];
MemoryStream ms = new MemoryStream(_img);
Template = new DPFP.Template();
Template.DeSerialize(ms);
Verificator = new DPFP.Verification.Verification();
// more code here...
}
}
}
}
}