private void textBox1_TextChanged(object sender, EventArgs e) { if (textBox1.TextLength == 4) { SqlConnection ConnCMS = new SqlConnection(); string SqlConnectionString; SqlConnectionString = "Server=10.1.1.28; Database=cms;uid=sa; pwd=samesame;"; ConnCMS.ConnectionString = SqlConnectionString; SqlCommand cmdSelect = new SqlCommand("select FingerImage from EmployeeFinger where EmployeeNo=@ID", ConnCMS); cmdSelect.Parameters.Add("@ID", SqlDbType.NVarChar).Value = textBox1.Text; SqlDataAdapter sqlDA = new SqlDataAdapter(cmdSelect); DataSet ds = new DataSet(); sqlDA.Fill(ds, "EmployeeFinger"); int c = ds.Tables["EmployeeFinger"].Rows.Count; if (c > 0) { Byte[] byteBLOBData = new Byte[0]; byteBLOBData = (Byte[])(ds.Tables["EmployeeFinger"].Rows[0]["FingerImage"]); MemoryStream stmBLOBData = new MemoryStream(byteBLOBData); pictureBox1.Image = Image.FromStream(stmBLOBData); } ConnCMS.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)