Will do in 2 steps
1)You need to save image url in database and same image you need to save in your project folder using property
where fileUpload1 is the fileupload control and strSavePath is the variable where you assigned the path where you want to save the image.
2)Now following snippet is the part of grid view control ,that is template field by using template field you add asp:image cotrol and give the column name as value to the property imageUrl of asp.net image control as
ImageUrl ="'<%# Eval("Url") %>'"
<asp:Label ID="lblimg" runat="server">Image</asp:Label>
<asp:Image ImageUrl ="'<%# Eval("Url") %>'" runat="server" ID="imgCar" />
<ItemStyle HorizontalAlign="Center" />
now just bind the datatable to gridview ,your work is done.
Quote:After looking the comment for JsonMacD. i can say that you need to play at database level also with this above coding as following way.
create user defined function like this
create function fnreturn(@RoleId int) returns varchar(50)
Declare @Result varchar(50)
if((select count(*) from DashBoardItems where roleId=@RoleId)>2)
set @Result= '~/Image/upArrow.png'
set @Result= '~/Image/DownArrow.png'
which will return based on condition
and then use this function in your select query like this
select *,dbo.fnreturn(8) as URl from DashBoardItems
then now just you need to bind the result table to gridview.
Hope This will help-Happy coding