
108
|
Chapter 7: The .NET Framework Class Library
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Public Function CreateDataSet(ByVal sqlText As String, _
ByVal tableName As String) As Data.DataSet
' ----- Create a data set/data table from a SQL statement.
' The sqlText argument is the actual SQL statement
' used to retrieve the records. The tableName argument
' gives a meaningful name to the new data set, since
' the data set will not extract it from the SQL code.
Dim dbCommand As OleDb.OleDbCommand
Dim dbAdaptor As OleDb.OleDbDataAdapter
Dim dbNewSet As Data.DataSet
dbCommand = New OleDb.OleDbCommand(sqlText, DBLibrary)
dbAdaptor = New OleDb.OleDbDataAdapter(dbCommand)
dbNewSet = New DataSet
dbAdaptor.Fill(dbNewSet, tableName)
dbAdaptor = Nothing
dbCommand = Nothing
Return dbNewSet
End Function
ADO.NET is a robust and feature-rich set of database interfaces. Due to its size
and vast number of options, a full discussion is beyond the scope of this book. For
a complete treatment, see Bill Hamilton and Matthew MacDonald’s book, ADO.
NET in a Nutshell (O’Reilly Media).
The System.IO Namespace
The classes in the System.IO namespace provide a variety of input/output func-
tionality, such as:
• Manipulating directories (Directory class) and files (File class)
• Monitoring changes in directories and files (FileSystemWatcher class)
•