Image1.Visible=true;
SqlConnection con=new SqlConnection();
string imagename="";
try
{
con.Open();
SqlCommand com=new SqlCommand();
SqlDataReader dr=com.ExecuteReader();
dr.Read();
MemoryStream ms=new MemotyStream((Byte[])dr["name"]);
Bitmap img=new Bitmap(ms);
string filepath=Server.MapPath("Files/");
DirectoryInfo dir=new DirectoryInfo(filepath);
FileInfo[] filecount=dir.GetFiles();
int i=filecount.Length;
imagename=filepath+((i+1)+".jpg");
image.Save(imagename);
dr.close();
Image1.ImageUrl="Files/"+((i+1)+".jpg");
}
finally
{
con.Close();
}