473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Image in Grid View

Hi,
i am using the gridview to display the image, but the path only getting visisble..
Like this "/ShoppingGridView/images/1.jpg"
What is the wrong here.. please help me..


con.Open();
string queryString = "Select * from Item";
OdbcCommand com = new OdbcCommand(queryString, con);
OdbcDataReader DR1 = com.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("PictureID", typeof(int)));
dt.Columns.Add(new DataColumn("Picture", typeof(string)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));
while (DR1.Read())
{
DataRow dr = dt.NewRow();
dr["PictureID"] = DR1[0];
dr["Picture"] = ResolveUrl("~/images/"+DR1[0]+".jpg");
dr["Name"] = DR1[1];
dt.Rows.Add(dr);
}
GridView1.DataSource = dt;
GridView1.DataBind();
con.Close();
Apr 4 '08 #1
0 733

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Simon Harris | last post by:
Hi All, I have a data grid which displays country names. I now wish to display the country flag images above the names. Can someone please advise how I display an image in a datagrid? I have a...
10
by: kaczmar2 | last post by:
Hey there, I have a large image in a browser window, and I would like a way to overlay grid lines on top of the image, so a user can show the grid or hide the grid lines. The grid would cover...
3
by: kaczmar2 | last post by:
Hey there, I have a large image in a browser window, and I would like a way to overlay grid lines on top of the image, so a user can show the grid or hide the grid lines. The grid would cover...
8
by: MarkAurit | last post by:
I have to display some images kept into a sql server database (image data type) in an asp.net 1.1 page. Is it possible to use an asp control to display the contents of a byte or a MemoryStream?...
0
by: kvicky | last post by:
Is it possible to export an Image from a Grid view to excel? If so, can anybody please tell me how to do that? Thanks K
2
by: Umeshnath | last post by:
Hi, I have placed a grid view inside Atlas panel. On click of a button event, data is populated in the grid view, I want to add scroll bar instead of increasing the size of grid view. I have...
0
by: Andrew | last post by:
Hello Ive been messing around with a simple raw image viewer using Pil and Tkinter However I am running into problems displaying the images they appear to be not correct I believe it is cause of...
1
by: wardemon | last post by:
Hi, I have an image control which inside an ItemTemplate of a GridView Control. I've coded the ImageControl's ImageURL in "Source" to have a dynamically filled-up value ex: ImageURL = <%#...
4
by: glbdev | last post by:
Hi, I posted this question yesterday but didn't get the answer I needed. I am DESPERATE to get this working so I'm re-posting it because I don't think I worded it correctly. I have a GridView...
1
by: krishnaneeraja | last post by:
Hi, Iam working on windows based application.In that i dont know how to add image in grid view column. I want to add image column in grid view.Image path will be stored in Ms-Access database.I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.