I have create custom list..and submit Form data onto list by Visual webpart.but i have doubts when i have attach on the attachments of list. now a time to retrieve Data from custom list but how can i retrieve attachement file from list and easy to download by End user??? Plz anyone guard me
SPFolder folder = web.Folders["Lists"].SubFolders[list.Title].SubFolders["Attachments"].SubFolders[listitem.ID.ToString()];
Then you can do:
foreach (SPFile file in folder.Files)
{
// Do what you want to do with the file
}