Displaying Image from SQL Server in Crystal Report

2019-06-09 23:04发布

I have a couple of images in my SQL Server 2008 table of which the datatype is image.

In my VS.net 2008 project I have a crystal report which is displaying all the fields from that table, but the image is showing as a blank image.

Any thoughts, How I can make it work?

1条回答
淡お忘
2楼-- · 2019-06-09 23:32

You have to convert the image before you can show it.

In crystal reports, you can click on the image control and set the value property of the control to the following (replace ImageFieldName with your field name)

System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!ImageFieldName.Value), 105))
查看更多
登录 后发表回答