Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net System.Collections.ArrayList.ToArray方法为空_Vb.net_Linq_Expression Trees - Fatal编程技术网

Vb.net System.Collections.ArrayList.ToArray方法为空

Vb.net System.Collections.ArrayList.ToArray方法为空,vb.net,linq,expression-trees,Vb.net,Linq,Expression Trees,我正在尝试获取ToArray方法,但我总是获取null(无) 在网上搜索没有解决办法 编辑:我要生成此查询: Dim test = result.GroupBy(Function(row) groupedindexes.Select( Function(grpindex) row(grpindex)).ToArray, comp) 使用校正后的toarrayMethod我得到图像上的错误: 我知道,我必须更改此部分:GetType(

我正在尝试获取ToArray方法,但我总是获取null(无)

在网上搜索没有解决办法

编辑:我要生成此查询:

Dim test = result.GroupBy(Function(row) groupedindexes.Select(
                              Function(grpindex) row(grpindex)).ToArray, comp)
使用校正后的
toarrayMethod
我得到图像上的错误:

我知道,我必须更改此部分:
GetType(System.Collections.ArrayList)
我试图更改此部分,但后来我总是得到错误,即方法为null

我想象的是这样的:

Dim toarrayMethod = GetType(System.Func(Of Object(), IEnumerable(Of Object)))...
你能再帮我一次忙吗?

没有,这是你通过
“ToArray”请求的,新类型(){GetType(Object())}

您正在查找
ArrayList.ToArray()
ArrayList.ToArray(类型)


只有一个重载,该参数的类型是
type
而不是
Object()
。GetMethod(“ToArray”)应该足够了。仅使用GetMethod(“ToArray”)会给出错误“找到不明确的匹配”。如果我写GetMethod(“ToArray”,New Type(){GetType(Type())}),那么这个方法也算不了什么。那么,您需要传递一个空类型数组:
。GetMethod(“ToArray”,New Type(-1){})
顺便说一句,如果可以避免的话,您通常不想使用
ArrayList
。相反,您应该使用
List
Dim toarrayMethod = GetType(System.Func(Of Object(), IEnumerable(Of Object)))...
GetMethod("ToArray")
GetMethod("ToArray", New Type() {GetType(Type())})