How can I store and retrive an image(.jpg) file from MS-SQL and show it in my web form??

Dear all,

I want to store some pictures in the MS SQL database using some unique numbers to identyfy them. HOW??

 In my web form i'll enter a number in the text box and click a button. As a result of this event I want toretrive the particular image corresponding to that number  from the database and show it in my web form. But how should I do it??

Can anyone give me some guideline for doing so?? 

Ishtiaque Hussain
Dept. of Computer Science and Engineering
University of Dhaka,
4/25/2005 7:01:21 PM 16182 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 31

If you are looking for a GUID, use UniqueIdentifier. You can specify a new ID by setting the defaultvalue to NewID(). Otherwise, set the column of type int or bigint and set the identity to 1 with an increment value of 1. I'd imagine that int should work unless you're uploading a ton of images.
Jason N. Gaylord
ASPInsider and Microsoft MVP
4/25/2005 7:48:47 PM

Similar Artilces:

My form can do a file upload but can't do a file download (from a sql image column)
Hi everyone, I've created an ASP.NET C# form that displays a record from a SQL database on the web. I can get everything to load fine except for a file stored in an "image" (datatype) field. What I want is the page to display either a picture or a link or something that the user can click to download the file. I can't seem to figure out is: 1. what type of object to put in the form (text link, image, etc.) to allow for a downloadable file. 2. how to assign the file contained in the image column to some sort of variable. For the other columns in the sql table I...

I submit a form and insert data to the sql, then I want to show the thank you message, not show the form. how can I switch the form to the thank you message.
Here is my code: if (Page.IsPostBack) // form submitted {SqlConnection sc = null; SqlCommand command = null; try {sc = new SqlConnection(ConfigurationManager.ConnectionStrings["SiteSource"].ConnectionString); sc.Open();String strSQL = String.Format(@"INSERT INTO Contactus (ContactusEmail,ContactusFirstName,ContactusLastName, ContactusPhone, ContactusComments, ContactusDate) VALUES ( '{0}', '{1}', '{2}', '{3}', '{4}', '{5}')", EmailBox.Text, FirstNameBox.Text, LastNameBox.Text, PhoneBox.Text, CommentsTextBox.Text,...

Implementing .Net Form into an web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

How can i Store image (.jpg , .gif) in a database (SQL SERVER)
hi to all !!!! i want to store the image file from user click in SQL Server , so how can i ?? How can i Store image (.jpg , .gif) in a database . pls send me Code or any thing which helps me ...Jay "Enjoy Life" In the example below I used a file upload control to get the image file. You also must have column in your database table that is defined as an image. This code will give you a ByteArray that can be saved to the database. Note(fuldpic is the file upload control)[pre]string imgContentType = "";            int imgLen = 0;&...

.aspx file extension shows as a web form and I can not run?
I've just installed the .net framework developer package. I've also got IIS running on my local machine which is XP pro. When I run a aspx file from local host it comes up as page not found. I can run html/htm files fine without any problems. I looked at the files extension on windows explorer and it comes up as .aspx is a web form and not Can anyone help? How you are running the file! May be You are not giving the path correct on the browser! Got to IIS, from there try to open the file and see what happend! Also check if IIS is running or not! Sreedharhttp://www....

How i can display image on C# web form through ms-access
Hi All!! I'm using following code to display my image on web page. Image is stored in database as OLE object unser "img_stream" variable.private void Page_Load(object sender, System.EventArgs e)            {                  // Put user code to initialize the page here                  myAccessConnection = new OleDbConnection(connStr);   &nb...

How can i add a link which will be showed as a image on web form?
How can i add a link which will be showed as a image on web form? I mean a image with a link in it. Thanks if your developing your own web form then just use the imagebutton control. another option is <a href =>StepXToolbar</a> This tool will let you add links or images, rollovers, external or Internal nav points and can be used to raise events to other modules on the page. Trial version available for download. [LINK CORRECTION] if your developing your own web form then just use the imagebutton control. another option is StepXToolb...

when the user clicks the image button to show the calendar extender on my web form it submits the whole form instead of showing the calendar??
when the user clicks the image button to show the calendar extender on my web form it submits the whole form instead of just showing the calendar??  I have another button that submits the form. my calendar image button is acting like a submit button also instead of acting like a calendar popout button. Does anybody know how I can set an image button to not submit the form and cause my validations to render. I only want it to pop out the Ajax calendar for the specific textbox?   <ajaxToolkit:CalendarExtender runat="server" TargetControlID="txt...

How to connect PB .NET Web Forms to MS SQL 2005 via SNC using "Windows Authentication"?
Dear All, I have a PowerBuilder native client / server application which connects fine to the Microsoft SQL Server 2005 back-end database via the SNC native driver using "Windows Authentication" (NOT "SQL Server Authentication"). The corresponding program code being used is as shown below: ///////////////////////////////////////////////////////////////////////////////////////////////////////// String ls_userid, ls_password ls_userid = sle_id.Text ls_password = sle_password.Text IF Len(ls_userid) <> 0 AND Len(ls_password) <> 0 THEN // Pro...

how to save file (stored on SQL server) to file/web server?
Hi Experts, I got files stored on SQL server db. I would like to be able to save them onto file/web server. I know how to retrieve them, but not sure how to save to file/web server. Please help. Thanks so much. Below are codes for retrieving file info from sql server:Dim strFileName As String = Quote.GetQuoteFileByQuoteFileID(CInt(selectedQuoteFileID)).Tables(0).Rows(0).Item("QuoteFileName")Dim strFileType As String = Quote.GetQuoteFileByQuoteFileID(CInt(selectedQuoteFileID)).Tables(0).Rows(0).Item("QuoteFileType")Dim strFileSize As Integer = Quote.GetQuoteFileByQuoteFileID(CInt(selectedQ...

How can I uplaod image file to SQL server and display uploaded files
This is my first time to create web site by using Visual web developer express 2005. I want to create company's activity member profile web page by use sql database. But I don't know how to create SQL DB and Table and I don't know code for connect to sql server, code for upload image files, data file, and code for displays images. So please tell me how to do it step by step. (I use VS web developer express 2005 with Thank you  this link should help

Transfer the Image Stored in a .gif File to an Image Column in a SQL Server Table
I am trying to use images in my web form and I am trying to write thie executable to help transfer the gifs into the SQL column. Here is my code, I am getting an error. All help is appreciated. Thanks in advance. ----------------------------------------------------------------------------------------- Dim connString1 As String = ConfigurationSettings.AppSettings("connString1") 'bkf-sql1/jHelp Dim cnnConnection As New System.Data.SqlClient.SqlConnection(connString1) Dim rs As ADODB.Recordset Dim mstream As ADODB.Stream Private Sub Page_Load(ByVal s...

For interrupting.web form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form
Web Form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form ! Because of my pool English, if you can't see , I will explain more ! ThanksGambler is the real life I guess you mean when form grows it also grow parent div element. This is normal. If you want div to stay fixed size and rather clip the form and maybe show a scrollbar, look at overflow property in CSS.Thanks------------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no ...

Retrieving image from 1 form to another form. (VB.Net & MS Access)
Hello!I'm getting the image in 1st form from database. When I'm moving to 2nd form how can i get the same image in form load?Thanks & RegardsPrasanna T Hi, Based on my understanding, you can display an image which is stored in the database on the form, and you want to display this image on another page.  If I have misunderstood you, please feel free to let me know. If we want to display the same image that is stored in the database, we can save the image into the folder and then refer to this image path using Image control on another page. I hope this helps. Thomas...

Web resources about - How can I store and retrive an image(.jpg) file from MS-SQL and show it in my web form?? -

Snaptell Explorer retrives product listings from the iPhone's camera
Oh man finally, we're getting an app that fulfills the promise of the iPhone. Ever since we knew the iPhone would have a camera and an internet ...

Reading Company Shares - LinkedIn Developer Network
Reading Company Shares Nov 16, 2011 — Kirsten Jones You can use the Company Updates API to read shares for a particular company Note: Before ...

Canberra's Number 1 Hit Music Station
Canberra's Number 1 Hit Music Station

NXFM - Newcastle's Number 1 Hit Music Station
NXFM is Newcastle's number 1 hit music station

Nikos Anagnostou - Webtropic
Read all of the posts by Nikos Anagnostou on Webtropic

Store Products
Skip navigation Customers outside the USA can visit our International Distributor page to locate an Alesis representative in your region. DM10 ...

My Profile Profile registration * - mandatory * Nickname: * Password: * Retype the password: * Email: (email will be used to login or retrive ...

This Amazon Storage Facility Will Probably Outlive Us All
... and start backing up your iTunes library, you should probably know that this isn't exactly normal cloud computing. It'll take hours to retrive ...

Faster than a locomotive, leap over giant buildings - yes, its... SMS! Text messaging has twice the users ...
Mobile phone based messaging is 2.6 times as big by users, as email. Mobile phone based messaging has twice as many active users as the total ...

Videos about Rob Ford’s alleged video with crack cocaine in Toronto -
... addressed the alleged video of Mayor Rob Ford smoking a substance believed to be crack cocaine. Despite controversial efforts to retrive the ...

Resources last updated: 1/5/2016 11:49:31 PM