如何显示位于文件夹中且路径位于数据库中的学生图片但我无法执行此操作我搜索了很多但没有找到任何有用的东西。请帮助我伙计们
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string query = @"select StudentID,c.DocumentType as DocumentID,DocumentNumber,Name,NameDari,FatherName,FatherNameDari,MobileNumber,Photo,b.ClassName as ClassID,d.LocationName as LocationID,e.TeacherName as TeacherID,a.Term,a.Score from StudentsInfo a
join Class b
on a.ClassID=b.ClassID
join Document c
on c.DocumentID=a.DocumentID
join Location d
on d.LocationID=a.LocationID
join Teachers e
on e.TeacherID=a.TeacherID";
var data = db.Database.SqlQuery<StudentsInfo>(query);
ReportViewer1.SizeToReportContent = true;
ReportViewer1.LocalReport.ReportPath = Server.MapPath("Certificates.rdlc");
ReportViewer1.LocalReport.DataSources.Clear();
ReportDataSource ds = new ReportDataSource("Certificates", data);
ReportViewer1.LocalReport.DataSources.Add(ds);
this.ReportViewer1.LocalReport.EnableExternalImages = true;
ReportViewer1.LocalReport.Refresh();
}
}
Run Code Online (Sandbox Code Playgroud)