The output from this program is as follows: numberOfRows = 3 Reading from the Products DataTable ProductID = 1 ProductName = Chai UnitPrice = 18 ProductID | The output from this program is as follows numberOfRows 3 Reading from the Products DataTable ProductID 1 ProductName Chai UnitPrice 18 ProductID 2 ProductName Chang UnitPrice 19 Reading from the Customers DataTable CustomerlD ALFKI CompanyName Alfreds Futterkiste Changing the CommandText Property of the SelectCommand You can also populate a DataSet with multiple DataTable objects by changing the CommandText property of the SelectCommand for your DataAdapter object before each call to the Fill method. First the following code populates a DataSet with a DataTable containing two rows from the Products table SqlCommand mySqlCommand SELECT TOP 2 ProductID ProductName UnitPrice FROM Products ORDER BY ProductID SqlDataAdapter mySqlDataAdapter new SqlDataAdapter mySqlCommand DataSet myDataSet new DataSet int numberOfRows myDataSet Products The myDataSet object now contains a DataTable named Products. Next the CommandText property for the SelectCommand of mySqlDataAdapter is changed to a SELECT statement that retrieves rows from the Customers table and the Fill method is called again SELECT CustomerID CompanyName FROM Customers WHERE CustomerlD ALFKI numberOfRows myDataSet Customers The myDataSet object now contains an additional DataTable named Customers. Listing shows a program that uses the code examples shown in this section. illustrates how to populate a DataSet object with multiple DataTable objects by changing the CommandText property of a DataAdapter object s SelectCommand using System using using class MultipleDataTables2 public static void Main SqlConnection mySqlConnection new SqlConnection server localhost database .