【发布时间】:2013-11-22 09:53:47
【问题描述】:
我创建了一个水晶报表来显示我的每月销售详细信息,因此我创建了报表和数据集 SQL 连接,并且我的所有代码都在工作,但是当我给出 2 个日期时,它给了我一个错误:
"file notfound exception was unhandled" , "Could not load file or 程序集 'file:///C:\Program Files (x86)\SAP BusinessObjects\Crystal .NET Framework 4.0\Common\SAP BusinessObjects Enterprise 的报告 XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' 或其依赖项之一。 系统找不到指定的文件。”
这是关于引用吗?
try
{
CRPinvDate rpt = new CRPinvDate();
//my report.
SqlConnection myConnection = default(SqlConnection);
SqlCommand MyCommand = new SqlCommand();
SqlDataAdapter myDA = new SqlDataAdapter();
sDate_DS myDS = new sDate_DS();
//my dataset
myConnection = new SqlConnection(cs);
MyCommand.Connection = myConnection;
MyCommand.CommandText = "select * from Invoice_Info where Invoice_Date between @Invoice_Date1 and @Invoice_Date2";
MyCommand.Parameters.Add("@Invoice_Date1", SqlDbType.DateTime, 30, "Invoice_Date").Value = DateFrom.Value.Date;
MyCommand.Parameters.Add("@Invoice_Date2", SqlDbType.DateTime, 30, "Invoice_Date").Value = DateTo.Value.Date;
MyCommand.CommandType = CommandType.Text;
myDA.SelectCommand = MyCommand;
myDA.Fill(myDS, "Invoice_Info");
rpt.SetDataSource(myDS);
crystalReportViewer1.ReportSource = rpt;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
【问题讨论】:
-
是的,它是关于引用的,你是否在引用中添加了正确的 dll 并且你是从这个类中引用它吗?
-
希望我添加了正确的 dll。但是有没有可能找到并重新添加一个dll文件?
-
从引用列表中删除 dll,单击 Dll 之一并按删除按钮,现在右键单击引用 -> 添加引用 -> 浏览并找到正确的 dll,选择并按确定,现在已添加到您的参考资料。
-
试过了,还是没有改善
-
找到解决方案。我刚刚编辑了我的 appconfig 启动部分,如下所示
标签: c# sql winforms crystal-reports