users upload the bulk images in different folders as categories like birds,animals,flowers.Images a

Posted by Chanti444 under ASP.NET on 10/14/2011 | Points: 10 | Views : 965 | Status : [Member] | Replies : 5
hi,,,,,,

users upload the bulk images in different folders as categories like birds,animals,flowers.Images are stored in different folders and their path is saved in database.
Here my task is retrieve these images from these folders and displaying in the grid view.But when i retrieve the images as grid view ,there iam not getting images.

satya


Responses

Posted by: Gausi on: 10/14/2011 [Member] Starter | Points: 25

Up
0
Down
please provide your code so that we can try..

Regards,

Gaurav Singh
(gausi)

Chanti444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chanti444 on: 10/14/2011 [Member] Starter | Points: 25

Up
0
Down
qlCommand mycommand = new SqlCommand("GETGALLERYIMAGE", con);
SqlDataAdapter myda = new SqlDataAdapter();
DataSet myds = new DataSet();

mycommand.CommandType = CommandType.StoredProcedure;
con.Open();
myda.SelectCommand = mycommand;
myda.Fill(myds, "galleryimage");

GridView1.DataSource = myds;
GridView1.DataBind();
con.Close();

satya

Chanti444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chanti444 on: 10/14/2011 [Member] Starter | Points: 25

Up
0
Down
here gallery image is my table name that contan only one column field is imagepath
like below

D:\gallery\2015\jun\13\08-00\birds\birds\1236042179XOjViw.jpg
D:\gallery\2015\jun\13\08-00\birds\birds\birds-flying-764101.jpg
D:\gallery\2015\jun\13\08-00\birds\birds\birds.png
D:\gallery\2015\jun\13\08-00\birds\birds\common_buzzard_AEA251.JPG
D:\gallery\2015\jun\13\08-00\birds\birds\elegant22.jpg
D:\gallery\2015\jun\13\08-00\birds\birds\flying_birds-1234-937016.jpeg

getimagegallery is stored procedyure name like code below

CREATE PROCEDURE GETGALLERYIMAGE
AS
SELECT IIMAGEPATH FROM GALLERYIMAGE

satya

Chanti444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chanti444 on: 10/14/2011 [Member] Starter | Points: 25

Up
0
Down
let me knw what should i wrong here

satya

Chanti444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gausi on: 10/14/2011 [Member] Starter | Points: 25

Up
0
Down
u cant use complete absolute path like "D:\gallery\2015\jun\13\08-00\birds\birds\1236042179XOjViw.jpg".
For binding to image in gridview u have to use relative path.

For Example:-

Path= Server.MapPath(".")+"\\gallery\\2015\\jun\\13\\08-00\\birds\\birds\\1236042179XOjViw.jpg"


note : Server.MapPath(".") will return Your Application Directory Hence no need to save complete path in database just store folder path or just image name and create relative path at a time of binding as shown in example.


Regards,

Gaurav Singh
(gausi)

Chanti444, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response