problem in retrieving image stored in sql server 2005
I am trying to retrieving image from sql server 2005 into asp.net web page using c#, here is my code

    SqlCommand getImageCmd = new SqlCommand("select Image from Images where ImageName = '" + getImageDropDownList.SelectedValue.ToString() + "'", con);
    byte[] imageData = (byte[])getImageCmd.ExecuteScalar();
    
    FileStream fs = new FileStream("path, FileMode.OpenOrCreate, FileAccess.Write);
        
    fs.Write(imageData, 0, (imageData.Length) );
       
    Image1.ImageUrl = "path";
    fs.Close();

problem is i am not getting any output in my Image control.

here is my code i used to store images into database:
byte[] data = ImageUpload.FileBytes;

    SqlCommand sc = new SqlCommand("insert into Images(ImageName,Image) values (@n, @p)", con);
    sc.Parameters.AddWithValue("@p", data);
    sc.Parameters.AddWithValue("@n", imageNameTextBox.Text);
    sc.ExecuteNonQuery();
problem in retrieving image stored in sql server 2005
===

I am trying to retrieving image from sql server 2005 into asp.net web page using c#, here is my code

    SqlCommand getImageCmd = new SqlCommand("select Image from Images where ImageName = '" + getImageDropDownList.SelectedValue.ToString() + "'", con);
    byte[] imageData = (byte[])getImageCmd.ExecuteScalar();
    
    FileStream fs = new FileStream("path, FileMode.OpenOrCreate, FileAccess.Write);
        
    fs.Write(imageData, 0, (imageData.Length) );
       
    Image1.ImageUrl = "path";
    fs.Close();

problem is i am not getting any output in my Image control.

here is my code i used to store images into database:
byte[] data = ImageUpload.FileBytes;

    SqlCommand sc = new SqlCommand("insert into Images(ImageName,Image) values (@n, @p)", con);
    sc.Parameters.AddWithValue("@p", data);
    sc.Parameters.AddWithValue("@n", imageNameTextBox.Text);
    sc.ExecuteNonQuery();