Drill into the DataSet XSD
In the last installment we created a new ODBC dataset. In this article we will drill under the covers of the XSD to see what makes up the dataset. In earlier .NET data access techniques a Connection object represented the server and database that would be accessed, and a Command object could be created that used that connection to execute the desired SQL statement. The Command object could be used directly to read a data stream that was referenced using a DataReader object,
or a set of Command objects could be embedded in a DataAdapter object that was able to Fill a DataTable from an intermittent Connection.
When we look at the XSD structure that is created for the DataSet, it first looks quite different, but as we drill deeper into the code we find a slightly different adapter, the database table specific TableAdapter.
When we look further inside the TableAdapter we find the DataAdapter once again, along with the Connection object and collection of Command objects.
As the TableAdapter is initialized, the embedded DataAdapter is as well.
When asked to fill its dedicated table, the Table adapter calls upon the embedded DataAdapter to do the heavy lifting.
So while the DataSet creation is a great improvement on coding data access by hand, it continues to use the familiar data access objects behind the scenes.