本文介绍了缺少参数值或COM异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我使用vs 2008在windows applciation中创建了一个水晶报告。
Crystal报告我直接调用了类文件,工作得很好。但我需要找到任何记录是否存在。所以我调用了类实例的Rows.Count方法。在此之后包括显示错误的应用程序作为
"缺少参数值"。

即是......" base {System.Runtime.InteropServices.ExternalException} = {" Missing parameters values。"}"

来源:" RptControllers.dll"

如果我删除只有onw线工作正常。如果我包括显示"发现COM异常",那么如何纠正这个问题或如何找到记录是否存在。因此,如果0我不需要显示报告

我的代码:

crvEmployee.ShowGroupTreeButton = false;
crvEmployee.DisplayGroupTree = false;
状态.Name =" Status";
StatusValue.Value = 1;
Status.CurrentValues.Add(StatusValue);
set1.Add(Status);
this.crvEmployee。 ParameterFieldInfo = set1;
EmployeeDetails emp = new EmployeeDetails();
int h = emp.Rows.Count;
foreach(emp.Database.Tables中的表cr) )
{
myTable = cr.LogOnInfo;
myTable.ConnectionInfo.ServerName = db.DataSource;
myTable.ConnectionInfo.DatabaseName = db.Database;
myTable.ConnectionInfo.UserID = db.UserName;
myTable.ConnectionInfo.Password = db.Password;
cr.ApplyLogOnInfo(myTable);
} this.crvEmployee.ReportSource = emp;

我现在添加的粗体字母只会引发错误

解决方案

hi friends,

      I created one crystal report in windows applciation using vs 2008.
Crystal reports i call the class file directly and working nice. But i need to find any records are exists or not . so i called the Rows.Count method of class instance. After this is included the application showing the error as

"Missing Parameter Values."

that is .. " base {System.Runtime.InteropServices.ExternalException} = {"Missing parameter values."} "

Source : "RptControllers.dll"

If i remove that only onw line working fine. if i include showing "COM Exception was Found"

So how can i rectify this issue or how can i find records are exist or not. So if 0 i not need to show the report

My code:

                crvEmployee.ShowGroupTreeButton = false;
                crvEmployee.DisplayGroupTree = false;
                Status.Name = "Status";
                StatusValue.Value = 1;
                Status.CurrentValues.Add(StatusValue);
                set1.Add(Status);
                this.crvEmployee.ParameterFieldInfo = set1;
                EmployeeDetails emp = new EmployeeDetails();
                int h = emp.Rows.Count;
                foreach (Table cr in emp.Database.Tables)
                {
                    myTable = cr.LogOnInfo;
                    myTable.ConnectionInfo.ServerName = db.DataSource;
                    myTable.ConnectionInfo.DatabaseName = db.Database;
                    myTable.ConnectionInfo.UserID = db.UserName;
                    myTable.ConnectionInfo.Password = db.Password;
                    cr.ApplyLogOnInfo(myTable);
                }
                    this.crvEmployee.ReportSource = emp;

The bold letters i added now so only raise the error

解决方案


这篇关于缺少参数值或COM异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 10:09