Sharepoint - How to get attachment URL programmatically From SharePoint list item?
I found answer for my question.
private string GetAttachmentUrls(SPListItem oItem)
{
string path = string.Empty;
try
{
path = (from string file in oItem.Attachments
orderby file
select SPUrlUtility.CombineUrl(oItem.Attachments.UrlPrefix, file)).FirstOrDefault();
return path;
}
catch
{
return string.Empty;
}
}