问题描述
受保护的无效Button5_Click(对象发送者,EventArgs e)
{
con = new SqlConnection("Server =(local); initial catalog = master; Trusted_Connection = True");
con.Open();
字符串str =从Empdet中选择*,其中EmployeeID ="" + DropDownList1.SelectedValue +''";
SqlCommand com =新的SqlCommand(str,con);
SqlDataAdapter sqlda =新的SqlDataAdapter(com);
DataSet ds = new DataSet();
sqlda.Fill(ds,"Empdet");
con.Close();
ReportDocument r1 =新的ReportDocument();
字符串路径= Server.MapPath("Reports/Employee.rpt");
r1.Load(path);
r1.SetDataSource(ds);
CrystalReportViewer1.ReportSource = r1;
CrystalReportViewer1.RefreshReport();
文本框按钮.
在文本框中,当我输入partiuclar员工ID并单击按钮时,错误如下
加载报告失败.请帮助我并发送代码.
protected void Button5_Click(object sender, EventArgs e)
{
con = new SqlConnection("Server=(local);initial catalog=master;Trusted_Connection=True");
con.Open();
string str = "select * from Empdet where EmployeeID=''" + DropDownList1.SelectedValue + "''";
SqlCommand com = new SqlCommand(str, con);
SqlDataAdapter sqlda = new SqlDataAdapter(com);
DataSet ds = new DataSet();
sqlda.Fill(ds, "Empdet");
con.Close();
ReportDocument r1 = new ReportDocument();
string path = Server.MapPath("Reports/Employee.rpt");
r1.Load(path);
r1.SetDataSource(ds);
CrystalReportViewer1.ReportSource = r1;
CrystalReportViewer1.RefreshReport();
Textbox Button.
In textbox when i type partiuclar employee id and click the button,Error As follows
Load Report failed.please help me and send the code.
推荐答案
这篇关于出现加载报告失败错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!