You must Sign In to post a response.
  • Category: ASP.NET

    How To Get File name along with path from DB to Navigate Url prop of Hyperlink Controls

    Hi All,

    can anyone help me out for the below requirement??

    How To Get File name along with path from DB to Navigate Url prop of Hyperlink Controls???



    Thanks,
    Chitaranjan
  • #756352
    DECLARE @FilePath VARCHAR(100)
    SET @FilePath = 'C:\Test\Test.txt'

    SELECT LEFT(@FilePath,LEN(@FilePath) - CHARINDEX('\',REVERSE(@FilePath),1) + 1) [File Path],
    REVERSE(LEFT(REVERSE(@FilePath),CHARINDEX('\', REVERSE(@FilePath), 1) - 1)) [File Name]

    Refer the below link for more details
    http://www.codeproject.com/Tips/866934/Extracting-the-filename-from-a-full-path-in-SQL-Se


  • Sign In to post your comments