Public ReadOnly Property Col() As Collection
Get
Return _col
End Get
End Property
Public Sub add(ByVal tmpTable As WXTable)
If IsNothing(_col) Then
_col = New Collection
End If
_col.Add(tmpTable)
End Sub
Public Function add(ByVal strKey As String) As WXTable
Dim obj As New WXTable
If IsNothing(_col) Then
_col = New Collection
End If
'obj.ID = FullSampleID
'obj.Desc = Desc
_col.Add(obj, strKey)
Return obj
End Function
Public Sub Remove(ByVal Name As String)
_col.Remove(Name)
End Sub
Public Function Count() As Integer
Return _col.Count
End Function
Public Sub Clear()
_col.Clear()
End Sub
Public Function Item(ByVal Name As String) As WXTable
Return _col(Name)
End Function
Public Function Item(ByVal key As Integer) As WXTable
Return _col(key)
End Function
End Class
从数据库中导出数据到DataTable:
Dim objDA As New System.Data.SqlClient.SqlDataAdapter("select * from tbl where id=1", _
New System.Data.SqlClient.SqlConnection("server=Local;initial catalog=pubs;"))
Dim objDS As New DataSet
Dim objDT As New DataTable