C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Show images in ASP.NET GridView control


Posted Date: 07 Dec 2007    Resource Type: Code Snippets    Category: ASP.NET GridView

Posted By: Bharathi       Member Level: Diamond
Rating:     Points: 10



This code sample shows how to display images in a Data GridView control.

This code example assumes that the page of the image is stored in the database and images are stored in the application path.

ASP.NET code:
						








Code for data binding:

	
DataSource of the GridView Like :

DataTable dt = new DataTable();
dt.Columns.Add("FilePath");

DataRow dr = dt.NewRow();
dr[0] = "~//Images/DSC00573.JPG";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = "~//Images/DSC00574.JPG";
dt.Rows.Add(dr);

GridView1.DataSource = dt;
GridView1.DataBind();





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Editing,deleting,sorting and paging in a datagrid
Previous Resource: Sum In Gridview Footer
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET GridView


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

silicone halloween masks

Contact Us    Privacy Policy    Terms Of Use