1 Star 1 Fork 0

VectorTree/JiaXin_XiaoXing_ReportSystem

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CommonExt.vb 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/AllocateMyAddress/jia-xin_-xiao-xing_-report-system.git
git@gitee.com:AllocateMyAddress/jia-xin_-xiao-xing_-report-system.git
AllocateMyAddress
jia-xin_-xiao-xing_-report-system
JiaXin_XiaoXing_ReportSystem
master

搜索帮助