C# c winform microsoft报表数据库映像不显示

C# c winform microsoft报表数据库映像不显示,c#,.net,winforms,ms-reports,C#,.net,Winforms,Ms Reports,我已经检查了stackoverflow、google、youtube、msdn资源。MSDN说,我需要使用picturebox,使用我的数据库并设置mime类型。我已经做到了。但图像并没有显示出来 如何将任何类型的图像(如jpg、png等)从数据库显示到Microsoft Report RDLC?我已将图像以二进制类型保存到数据库中 ReportViewer.cs: _connection.Open(); _aPatient = new Patient(); String QuearStrin

我已经检查了stackoverflow、google、youtube、msdn资源。MSDN说,我需要使用picturebox,使用我的数据库并设置mime类型。我已经做到了。但图像并没有显示出来

如何将任何类型的图像(如jpg、png等)从数据库显示到Microsoft Report RDLC?我已将图像以二进制类型保存到数据库中

ReportViewer.cs:

_connection.Open();
_aPatient = new Patient();

String QuearString = String.Format(
    "SELECT ImageReportStorageTable.ImageOne From ImageReportStorageTable " +
    " WHERE   (ImageReportStorageTable.PrescriptionCode = 21)");
String baseString=null;
_command = new SqlCommand(QuearString, _connection);
SqlDataReader aReader = _command.ExecuteReader();

if (aReader.HasRows)
{
    while (aReader.Read())
    {
        baseString = Convert.ToBase64String((byte[]) (aReader[0]));
    }
}
_connection.Close();

ReportParameter paramLogo = new ReportParameter();
paramLogo.Name = "Image1";
paramLogo.Values.Add(baseString);
prescriptionReportViewer.LocalReport.SetParameters(paramLogo);
我已将上述查询返回的值用于报表查看器图像属性函数

=System.Convert.FromBase64String(Parameters!Image1.Value) 

对于未来-我认为,将图像存储到数据库不是一个好主意。-约翰尼:嗯,你提到的帖子列出了两种方法的优缺点。也许这篇帖子有帮助:。我已经根据那篇帖子尝试过了。但是我的代码根本没有达到转换方法!它在看到分配给baseString的aReader值时立即返回报告查看器窗口。