K
Kreol
нет все же я больше хочу вот так, но не знаю где мне правильно прописать УРЛ для картинки, это раз и
выводит ошибку
Код:
Bitmap bitmap = new Bitmap(stream);
Код:
Parameter is not valid.
Код:
protected void cmdView_Click1(object sender, EventArgs e)
{
MemoryStream stream = new MemoryStream();
SqlConnection connection = new
SqlConnection(@"Data Source=localhost;Initial Catalog=MayBase;Integrated Security=True");
try
{
connection.Open();
SqlCommand command = new
SqlCommand("SELECT Picture from im where id = 10", connection);
byte[] image = (byte[])command.ExecuteScalar();
stream.Write(image, 0, image.Length);
Bitmap bitmap = new Bitmap(stream);
Response.ContentType = "image/gif";
bitmap.Save(Response.OutputStream, ImageFormat.Gif);
//imgDB.ImageUrl = stream.Write(image, 0, image.Length);
}
finally
{
connection.Close();
stream.Close();
}
}