Click here to Skip to main content
15,922,574 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
Dear Friend,
When i am implementing a program i have some problem.I am inserted image in database very easily but now this time to show image i cant understand how to retrieve image in gridview from database.

So please give me information as soon as possible.

Thanks in advanced !!
Posted
Comments
[no name] 29-Jun-13 7:11am    
If you do a simple google search for "get image from database" you would be approximately 277,000,000 results. And none of those articles, links and tutorials helped you at all? You should have a look at www.whathaveyoutried.com also.

1 solution

first you should find control in row command...

C#
protected void gvUserInfo_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
      {
             Image img= (Image)e.Row.FindControl("image1");

                var Data=from p in p.TableName
                select p;

                img.ImageUrl=Data.first().ImageColumnName;

      }
}
 
Share this answer
 
v2
Comments
Member 8089110 29-Jun-13 8:43am    
i m not used dropdown list just only want to show data directly on database
Nirav Prabtani 29-Jun-13 8:46am    
see updated answer...:)
Member 8089110 29-Jun-13 9:09am    
would u like to give me grid view control code

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900