c# - Displaying image in reportviewer -


I am trying to display the images in the report viewer control in the C # Widnows application. The image data source is set to externally if I have a full path in the table field then it is working fine, but if I have the file name in the table field then I can not find the image.

Only File name: deef2d72-e75a-41d4- 8acd-086f7fe6aa89.bmp full path: file: /// C: \ MyApp Docs \ deef2d72-e75a-41d4-8acd-086f7fe6aa89.bmp

I am trying to code follwoing but not working with file name only

  & lt; Code & gt; String st = Application.StartupPath + @ "\\ docs \"; Cmd = new SQL Command ( "Select" + + + [[filename] in the name of the file documents where id = id ", CN);  

is to be covered by a single quote file path because it is a text in the SQL syntax, so should your code:

  string st = System.IO.Path.Combine (application.StartupPath, "Docs"); St = @ "file: ///" + St; cmd = new SQL Command ( "select" "+ + + + +" \ Filename from \ '+ [filename] document Area as where id = id ", CN);  

and check whether your SQL statement is such when debugging:

  select 'file: /// D: \ app \ admin \ Admin \ bin \ debug \ docs \ '+ [filename] is the name of the file where id = id  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -