private void button1_Click(object sender, EventArgs e)
{
SqlConnection cn = new SqlConnection(@"Data Source=SAZ-PC\SQLEXPRESS;Initial Catalog=Voted;Integrated Security=True");
SqlCommand cmd1 = new SqlCommand("select FINGERPRINT from Regdmem ", cn);
cn.Open();
Byte[] barrImg = (Byte[])cmd1.ExecuteScalar();
foreach (byte fp in barrImg)
{
Byte[] bytes = File.ReadAllBytes("D:\\Image.bmp");
bool cmp = barrImg.SequenceEqual(bytes);
if (cmp == true)
{
Form3 f3 = new Form3();
f3.Show();
this.Hide();
}
else
{
Application.Exit();
}
}
cn.Close();
}
In my database I have a table with a column named FINGERPRINT
. In that column, multiple images are stored.
I also have an image on my harddrive (D:\\Image.bmp
).
My question is, how do I check whether this image is already stored in my database and if so, go to the next form of my application.