整型的值不能转化为1维阵列 [英] value of type integer cannot be converted to 1-dimensional array

查看:100
本文介绍了整型的值不能转化为1维阵列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

课程是具有Web服务方法列表返回特定值的.asmx文件,这种方法GetMyEmployeeId就是这样的webmethod我会从我的网络表格,返回包含当前用户(主页)ID阵列

Curriculum is an .asmx file which has list of web service methods to return particular values, and this method GetMyEmployeeId is one such webmethod i will be calling from my webform, which returns an array containing current user (homepage) id

Public Function GetMyEmployeeId() As Integer()
            Return New Integer() {Current.HomepageUserId}
End Function

我想调用此WebService方法在我的表单,要得到当前雇员,这样我就可以把它传递给我的方法不同的是DoSomething的(这里需要返回的雇员为参数)

I would like to call this webservice method in my webform and have to get the current employeeID, so that I can pass it to my different method which is DoSomething(here it takes the returned employeeID as parameter)

_curTree是课程类的对象。

_curTree is the object of the curriculum class.

    Private Function GetEmployeeActual() As Items
    Dim item as Items       
    Dim employeeID As Integer()
                    'I am guessing that, am declaring the employeeID wrong ( it should not be an integer datatype may be because the GetMyEmployeeID returns an array of current user ID's)
    employeeID = _curTree.GetMyEmployeeId()
    item = DoSomething(employeeID)
                    'I am getting the error here as"value of type integer cannot be converted to 1-dimensional array"
    Return item
    End Function

请帮助我继续

推荐答案

此错误是因为你试图当它期望数组作为参数传递或函数的返回值一个整数引起的。你没有包括足够的在你的code更具体。 (这行是在错误?什么是employeeIDFilter?什么是DoSomething的?)

This error is caused because you are trying to pass as a parameter or function return value a single integer when it expects an array. You didn't include enough in your code to be more specific. (Which line is the error on? What is employeeIDFilter? What is DoSomething?)

这篇关于整型的值不能转化为1维阵列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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