You don't provide enough info relating to your question, such as where is the image stored, how is it stored (bytes, base64string, ect...), and what control you are trying to attach the image to.
However base on what you have provided this may help you.
exmple:
protected void Page_Load(object sender, EventArgs e) {
if (Convert.ToInt16(Session["CompanyID"].ToString()) > 0) {
con.Open();
SqlCommand cmd = new SqlCommand(
"select * from Companies where CompanyID="+
Session["CompanyID"],con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds,"Companies");
if (ds.Tables[0].Rows.Count > 0) {
Label1.Text = ds.Tables[0].Rows[0]["EmailID"].ToString();
byte[] img = ds.Tables[0].Rows[0]["MyImage"];
Image image1 = ConvertImage(img);
if(image1 != null)
}
}
}
private static Image ConvertImage(byte[] img) {
try {
if (img == null || img.Length == 0)
throw new Exception("Byte[] empty");
MemoryStream ms = new MemoryStream(img);
Image i = Image.FromStream(ms);
ms.Dispose();
return i;
}
catch(exception e) {
return null;
}
}