The problem is in the generation of the URL for the LinkClick.aspx fileserver handler. Note that the Content column value returned from your data source is of MS SQL Server datatype image and is NOT the proper value for fileticket querystring parameter passed to the LinkClick handler. Because the fileticketid querystring parameter needs to be set to an encrypted string of the form "fileid=256", I would pass the FileID column value returned from your datasource to a helper method something like this (untested and no error handling included):
public string MakeLinkClickURL(string fileID)
{
return DotNetNuke.Common.Globals.LinkClick("fileid=" + fileID, TabId, ModuleId)
}
Note that TabId and ModuleId are available as properties in your module control which should inherit from DotNetNuke.Entities.Modules.PortalModuleBase.
An even better helper method would make use of the DotNetNuke.Services.FileSystem.FileManager to determine the file url building it as either a direct url to a file in a Standard folder or as a LinkClick.aspx handler to a file in a Secure (or other folder mapping type) folder. Something like this - again without needed error handling:
public string MakeFileURL(string fileID)
{
var fileInfo = DotNetNuke.Services.FileSystem.FileManager.Instance.GetFile(Convert.ToInt32(fileID));
if (fileInfo == null)
{
// return a bad or default image url as appropriate
}
else
{
return DotNetNuke.Services.FileSystem.FileManager.Instance.GetUrl(fileInfo);
}
}
The image tag in your DataList markup will then look something like this (space added to opening/closing tag to post to this forum):
< img alt="" src="MakeFileURL(Eval("FileID") %>" / >
Finally, make sure that View permissions for the permitted user role(s) that can access the images have been applied to the Secure Folder in FileManager or your code or they will get an Access Denied error.