我对吉大港山区管理者来说,是一个新奇,在努力解决与我现行法典有关的问题时,我 and。
我似乎正在发现这一错误。
班级残疾者必须实施接口系统的分程序要求(文本作为HttpContext)。 Web.IHttpHandler 。
使用该守则
<%@ WebHandler Language="VB" Class="Handler" %>
Imports System
Imports System.Web
Imports System.Configuration
Imports System.Data.SqlClient
Public Class Handler
Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As HttpContext)
Dim connStr As String = ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString
Dim con As New SqlConnection(connStr)
Create SQL Command
Dim cmd As New SqlCommand()
cmd.CommandText = "Select * from My_Images" +
" where id =@id"
cmd.CommandType = System.Data.CommandType.Text
cmd.Connection = con
Dim ImageID As New SqlParameter("@investor", System.Data.SqlDbType.Int)
ImageID.Value = context.Request.QueryString("id")
cmd.Parameters.Add(ImageID)
con.Open()
Dim dReader As SqlDataReader = cmd.ExecuteReader()
dReader.Read()
context.Response.BinaryWrite(DirectCast(dReader("Image"), Byte()))
dReader.Close()
con.Close()
End Sub
Public ReadOnly Property IsReusable As Boolean _
Implements IHttpHandler.IsReusable
Get
Return True
End Get
End Property
End Class
是否有任何人的想法?
Thanks in advance