Public Class xdDataTables
Public Sub new
End Sub
Private dname As String
Public Function GetEnumerator() As System.Collections.Generic.IEnumerator(Of DataTable)
Return foxtable.DataTables.GetEnumerator
End Function
Default Public readonly Property Item(tname As String) As DataTable
Get
If Foxtable.DataTables.Contains(tname) Then
dname =tname
Return Foxtable.DataTables(tname)
Else
msgbox("测试,不存在表【" & tname & "】")
Return Nothing
End If
End Get
End Property
Public readonly Property count() As Integer
Get
Return foxtable.DataTables.count
End Get
End Property
Public readonly Property contains(tname As String) As Boolean
Get
Return foxtable.DataTables.contains(tname)
End Get
End Property
Public readonly Property xFind(Filter As String,Optional Sort As String ="" ) As DataRow
get
Dim sname As String=Foxtable.DataTables(dname).ConnectionName
Dim cmd As new SQLCommand
Dim dt As DataTable
cmd.ConnectionName = sname
If sort > "" Then
cmd.CommandText ="se lect * from " + dname +" where " + Filter + " order by " + sort
Else
cmd.CommandText = "se lect * from " + dname +" where " + Filter
End If
dt = cmd.ExecuteReader(True)
If dt.DataRows.count>0 Then
Return dt.DataRows(0)
End If
End get
End Property
End Class
Public mydatatables = new xdDataTables
readonly Property xDataTables As xdDataTables
Get
Return mydatatables
End Get
End Property
还不行

此主题相关图片如下:qq图片20181227155119.jpg
