-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageHandler.ashx
More file actions
24 lines (22 loc) · 850 Bytes
/
Copy pathImageHandler.ashx
File metadata and controls
24 lines (22 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<%@ WebHandler Language="C#" Class="ImageHandler" %>
using System;
using System.Web;
using System.Data.SqlClient;
public class ImageHandler : IHttpHandler {
public void ProcessRequest (HttpContext context) {
string imageid = context.Request.QueryString["ImID"];
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["HPSCDBNEW"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("select imagename from ApplicantDetails where RegestrationNumber =" + imageid, con);
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
context.Response.BinaryWrite((byte[])dr[0]);
con.Close();
context.Response.End();
}
public bool IsReusable {
get {
return false;
}
}
}