c#中rdlc报表提示“尚未为数据源..提供数据源实例”??
rdlc报表已经设置好,路径也没有错,请高手帮忙看看是哪里出问题了??没有分了,不好意思啊,跪求答案了。。privatevoidForm4_Load(objectsend...
rdlc报表已经设置好,路径也没有错,请高手帮忙看看是哪里出问题了??没有分了,不好意思啊,跪求答案了。。
private void Form4_Load(object sender, EventArgs e)
{
// TODO: 这行代码将数据加载到表“lWkqDataSet.pdb200412”中。您可以根据需要移动或移除它。
DataSet ds = new DataSet();
ds = dss();
Microsoft.Reporting.WinForms.ReportDataSource r = new Microsoft.Reporting.WinForms.ReportDataSource();
r.Name = "lWkqDataSet";
r.Value = ds.Tables[0];
this.reportViewer1.LocalReport.DataSources.Add(r);
this.reportViewer1.LocalReport.ReportPath = @"../../Report4.rdlc";
this.pdb200412TableAdapter.Fill(this.lWkqDataSet.pdb200412);
this.reportViewer1.RefreshReport();
}
DataSet dss()
{
SqlConnection conn = new SqlConnection("server=(local);database=22;uid=sa;pwd=;");
SqlDataAdapter da = new SqlDataAdapter("SELECT ID, Num, EmNum, EmName, Birthday, Sex, Dept, Diploma, EmType, InDate, IdCard, PayCal, NatPlace, PostCode, Tel, DwPlace, Job, Ext, Email, BasePay, Remark, OnJob, OutDate, Cause, Card, CardDate, OnIdCard FROM dbo.desmployee2 where id<30 ",
conn);
DataSet de = new DataSet();
da.Fill(de, "a");
conn.Close();
return de;
} 展开
private void Form4_Load(object sender, EventArgs e)
{
// TODO: 这行代码将数据加载到表“lWkqDataSet.pdb200412”中。您可以根据需要移动或移除它。
DataSet ds = new DataSet();
ds = dss();
Microsoft.Reporting.WinForms.ReportDataSource r = new Microsoft.Reporting.WinForms.ReportDataSource();
r.Name = "lWkqDataSet";
r.Value = ds.Tables[0];
this.reportViewer1.LocalReport.DataSources.Add(r);
this.reportViewer1.LocalReport.ReportPath = @"../../Report4.rdlc";
this.pdb200412TableAdapter.Fill(this.lWkqDataSet.pdb200412);
this.reportViewer1.RefreshReport();
}
DataSet dss()
{
SqlConnection conn = new SqlConnection("server=(local);database=22;uid=sa;pwd=;");
SqlDataAdapter da = new SqlDataAdapter("SELECT ID, Num, EmNum, EmName, Birthday, Sex, Dept, Diploma, EmType, InDate, IdCard, PayCal, NatPlace, PostCode, Tel, DwPlace, Job, Ext, Email, BasePay, Remark, OnJob, OutDate, Cause, Card, CardDate, OnIdCard FROM dbo.desmployee2 where id<30 ",
conn);
DataSet de = new DataSet();
da.Fill(de, "a");
conn.Close();
return de;
} 展开
1个回答
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询