I have a byte[]
column in a table that has fingerprint data stored in it. I wish to query the rows from a table only once and store the record set in a variable or somewhere in my code, so that I don't have to query the database each and every time. The query will return thousands of rows.
This will fetch all the records for me:
var table = (from a in context.tblFingerprints
select new {a} ).ToList();
I tried declaring a variable in AppData class: public List<object> TableData;
Then tried to store the variable 'table' values to it.
Data.TableData = table;
The error remains:
Cannot implicitly convert type
'System.Collections.Generic.List<<anonymous type: FingerprintTEST.tblFingerprint a>>'
to'System.Collections.Generic.List<object>'
This is how I wish to query the rows returned from the result for matching fingerprint:
foreach (var row in Data.TableData)
{
Template tem = new Template();
tem.DeSerialize(row.a.fingerTemplate);
if (tem != null)
{
// Compare feature set with particular template.
Verificator.Verify(features, tem, ref res);
if (res.Verified)
{...}
}
}
Any ideas please?