how to store images in image datatype in sql server
HttpHandler.aspx
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="HttpHandler.aspx.cs"
Inherits="HttpHandler"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Enter ID <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
Enter Name
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox><br />
Select image <asp:FileUpload ID="FileUpload1" runat="server" /><br />
<asp:Button ID="Button1" runat="server" Text="Save" onclick="Button1_Click" /><br />
<asp:Image ID="Image1"
runat="server"
Height="137px"
Width="130px"
/><br />
<asp:DropDownList ID="TextBox3" runat="server">
</asp:DropDownList>
<asp:Button ID="Button2" runat="server" Text="Search" onclick="Button2_Click" />
</div>
</form>
</body>
</html>
HttpHandler.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Data.SqlClient;
using System.Data;
using System.Web.UI.WebControls;
using System.Configuration;
public partial
class HttpHandler
: System.Web.UI.Page
{
//static SqlConnection con = new SqlConnection(@"Data
Source=.\SQLEXPRESS;AttachDbFilename=E:\websites\HttpHandlerDemo\App_Data\Database.mdf;Integrated
Security=True;User Instance
#SradhaWebCreations
Contact : +91-9040573923, +91-7008182025
http://sradhawebcreations.com/
http://sradhawebcreations.blogspot.in/
https://facebook.com/sradhawebcreations
https://www.facebook.com/Sradhawebeducation/
No comments:
Post a Comment