代码拉取完成,页面将自动刷新
Imports System.Runtime.CompilerServices
Module CommonExt
<Extension()>
Function TianheExtInclude(ByVal obj As Object, ParamArray arrFind() As Object) As Boolean
Dim arr
For Each arr In arrFind
If obj = arr Then
Return True
End If
Next
Return False
End Function
<Extension()>
Sub ExampleMethod(ByVal ec As Object,
ByVal n As Long)
Console.WriteLine("Extension method")
End Sub
<Extension()>
Public Function TianheExtToDataTable(rows As DataRow()) As DataTable
If rows Is Nothing Then
Return New DataTable()
ElseIf rows.Length = 0 Then
Return Nothing
End If
Dim tmp = rows(0).Table.Clone() '复制DataRow的表结构
For Each row As DataRow In rows
tmp.ImportRow(row) ' 将DataRow添加到DataTable中
Next
Return tmp
End Function
End Module
Public Class Common
Public Shared Function ToDataTable(rows As DataRow()) As DataTable
If rows Is Nothing OrElse rows.Length = 0 Then
Return New DataTable()
End If
Dim tmp = rows(0).Table.Clone() '复制DataRow的表结构
For Each row As DataRow In rows
tmp.ImportRow(row) ' 将DataRow添加到DataTable中
Next
Return tmp
End Function
End Class
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。