Click here to Skip to main content
13,002,321 members (74,699 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Dear Friends ,

I am having a default.aspx page in which at top left corner , top middle , and top right , bottom left side and bottom right side , i should upload or fetch image from database , so kindly explain me how to insert , update , image into database

and i should also fetch the image from database in pageload events at top left side , top middle , top right , bottom left and bottom right of the page
Posted 13-Oct-12 4:23am
Wes Aday 13-Oct-12 10:25am
Okay so do a google search for how to save and retrieve images for whatever database you are using
psychic6000 13-Oct-12 11:29am
your question doesnt give much information, first of all what kind of database you are connecting to? Oracle or SQL etc secondly you are connected to your database using LINQ datasource (or sql client connection).
anyway, you need a stream reader and byte array to convert/de-convert your image to bytes, than save/load it into/out of database
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Assuming the images should change, you shoudl find this usefull: A generic Image-From-DB class for ASP.NET[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Check this link[^]

and to show on page_load
drag image control and
fetch saved image url from database like

SqlConnection sqlconn = new SqlConnection("server=.\\sqlexpress;database=db;integrated security=true;");
            SqlCommand sqlcomm = new SqlCommand("select image_url from reg1", sqlconn);
            SqlDataReader dr = sqlcomm.ExecuteReader();
            if (dr.Read())
                string loc = dr["profile_dploc"].ToString();
                Image1.ImageUrl = "profilepicture/" + loc;
                Session["dp"] = loc;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 13 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100