گفتگوی بین amir.net و milade

1 پیام های بازدید کنندگان

  1. سلام داداش .
    از طریق پیام نتونستم جواب بدم ...
    این کد :

    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim stream As New MemoryStream()
    Dim connection As New SqlConnection("server=127.0.0.1;database=MyData;ui d=sa;pwd=yourpass")
    Try
    connection.Open()
    Dim command As New SqlCommand("select Picture from Image", connection)
    Dim image As Byte() = DirectCast(command.ExecuteScalar(), Byte())
    stream.Write(image, 0, image.Length)
    Dim bitmap As New Bitmap(stream)
    Response.ContentType = "image/gif"
    bitmap.Save(Response.OutputStream, ImageFormat.Gif)
    Finally
    connection.Close()
    stream.Close()
    End Try
    End Sub
نمایش پیام های بازدید کنندگان، از 1 تا 1 از 1 پیام