How to retrieve image form folder against specific id in gridview
below is code
string[] filePaths = Directory.GetFiles(Server.MapPath("~/Images/"));
List<ListItem> files = new List<ListItem>();
foreach (string filePath in filePaths)
{
string fileName = Path.GetFileName(filePath);
files.Add(new ListItem(fileName, "~/Images/" + fileName));
}
GridView1.DataSource = files;
GridView1.DataBind();
Now i want to retrieve data against specific id
CREATE TABLE [dbo].[tbl_Contdetail](
[Con_ID] [int] IDENTITY(1,1) NOT NULL,
[ContNo] [varchar](50) NULL,
[DID] [int] NULL,
[Con_Date] [date] NULL,
[PicPath] [varchar](200) NULL,
[PicName] [varchar](50) NULL,
CONSTRAINT [PK_tbl_Contdetail] PRIMARY KEY CLUSTERED
(
[Con_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
i will call image from DID