如何解决源包含无数据行错误 [英] how to solve the source contains no datarows error

查看:87
本文介绍了如何解决源包含无数据行错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello House,



我一直致力于C#Winform项目,大多数部分与报告有关,我是



使用ms报告(rdlc),我已经能够在我的系统上显示报告了,但是当b $ b b / b
部署到另一个系统时,它没有显示报告,我所遇到的错误是:



源包含无数据行以下是我的代码:



Hello House,

I have been working on a C# Winform project that most parts have to do with report, i am

using ms report(rdlc), i have been able to display the report on my system, but while

deploying to another system, it's not displaying the report, the error i am having is:

the source contains no datarows below is my code:

DataSet1TableAdapters.SelectRegisteredParentTableAdapter tb1 = new DataSet1TableAdapters.SelectRegisteredParentTableAdapter( );
                DataSet1.SelectRegisteredParentDataTable ds = tb1.GetData( );
                Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource( "DataSet1", ds.AsEnumerable( ).CopyToDataTable( ) );
                reportViewer1.LocalReport.DataSources.Clear( );
                reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
                reportViewer1.LocalReport.DataSources.Add( reportDataSource1 );
                reportViewer1.RefreshReport( )





请问有谁知道怎么解决这个问题?在此先感谢。



Please does anyone know how to fix this? Thanks in advance.

推荐答案

这篇关于如何解决源包含无数据行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆