我在 VB.Net 脚本文件中有一个函数,但它产生错误“CopyToDataTable”不是“system.array”的成员。有任何想法吗?
Public Function CollectionFromTable(tableName As String, sql As String, sortOrder As String) As DataTable
Dim foundRows() As DataRow
foundRows = ds.Tables(tableName).Select(sql, sortOrder)
Return foundRows.CopyToDataTable
End Function
注意:我在顶部有以下导入,但仍然出现错误。
Imports System
Imports System.Data
Imports System.Windows.Forms
Imports System.Math
Imports Microsoft.VisualBasic
Imports System.Collections.Generic
Imports System.Data.DataRow
Imports System.Linq
Imports System.Drawing
Imports System.Xml
Imports System.Collections