从'System.String'转换为'ArrayOfInt [英] convert from 'System.String' to 'ArrayOfInt

查看:94
本文介绍了从'System.String'转换为'ArrayOfInt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,
我有一个带有复选框列表的应用程序
网格视图将根据所检查的nbofCheckboxes显示记录的位置
以下是gridview的对象数据源. WGetTerminals方法
接收整数数组.
我应该在< asp:Parameter>中指定什么类型.为了接受int数组.
现在我有一个错误
(无法将参数"branchIDs"的值从"System.String"转换为"ReportingServices.RptService.ArrayOfInt")

< asp:ObjectDataSource ID ="ObjectDataSource2" runat =服务器"
SelectMethod ="WGetTerminalList"
TypeName ="ReportingServices.RptService.RptServiceSoapClient">
< SelectParameters>
< asp:Parameter DefaultValue ="1" Name ="branchIDs" Type ="Object"/>
</SelectParameters>

Dears,
I have an application with a checkboxlist
where a gridview will show records depending on the nbofCheckboxes checked
the following is the object data source for the gridview. The method WGetTerminals
receives array of int.
What Type shall i specify in the <asp:Parameter> in order to accept array of int.
Right now i have an error
(Cannot convert value of parameter ''branchIDs'' from ''System.String'' to ''ReportingServices.RptService.ArrayOfInt'')

<asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
SelectMethod="WGetTerminalList"
TypeName="ReportingServices.RptService.RptServiceSoapClient">
<SelectParameters>
<asp:Parameter DefaultValue="1" Name="branchIDs" Type="Object" />
</SelectParameters>

推荐答案

从标记中删除"branchIDs"参数.

在Code-Behind中使用ObjectDataSource的Selecting事件.

在那里"中,按如下所示设置您的属性:

Remove "branchIDs" parameter from markup.

Use Selecting event of ObjectDataSource at Code-Behind.

In There, set your attribute like this:

e.InputParameters["branchIDs"] = dataArray;


这篇关于从'System.String'转换为'ArrayOfInt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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