protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { cn.Open(); OleDbCommand cm = new OleDbCommand("select * from ImageCollection where img_id='"+DropDownList1.SelectedItem.ToString()+"'",cn); OleDbDataAdapter da = new OleDbDataAdapter(cm); OleDbDataReader dr = cm.ExecuteReader(); try { if (dr.Read()) { string image1 = Convert.ToString(DateTime.Now.ToFileTime()); string image2 = Convert.ToString(DateTime.Now.ToFileTime()); FileStream fs1 = new FileStream(image1, FileMode.CreateNew, FileAccess.Write); FileStream fs2 = new FileStream(image2, FileMode.CreateNew, FileAccess.Write); byte[] bimage1 = (byte[])dr["passport_photo"]; byte[] bimage2 = (byte[])dr["sign_photo"]; fs1.Write(bimage1, 0, bimage1.Length - 1); fs2.Write(bimage2, 0, bimage2.Length - 1); fs1.Flush(); fs2.Flush(); Image1.ImageUrl = Convert.ToString(fs1); Image2.ImageUrl = Convert.ToString(fs2); } dr.Close(); cn.Close(); } catch (Exception ex) { throw ex; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)