ADO.NET Samples for Visual Studio Code Name “Orcas” October 2006 CTP

 

ADO.NET provides data access APIs for the .NET Framework. New in this release is the ADO.NET Entity Framework which allows users to seamlessly interact with relational data in terms of objects (Object Relational Mapping).  ADO.NET Entities introduce the Entity Data Model and supporting infrastructure which bridges the mismatch between relational systems and object oriented systems. Users can leverage the new Object-Specific APIs or the new Entity Client ADO.NET Data Provider to program against their data models with the familiar ADO.NET abstractions (Connections, Commands and DataReaders). For more information see http://msdn.microsoft.com/data/ref/adonetnext

The samples provided here use our new abstractions and illustrate how they can be utilized to program against the Northwind Database. The samples are organized into the following projects (for both VB and C#):

 

 

 

 

There are also some utility projects that are reused by the above projects; these differ between the VB and C# solutions and illustrate two different approaches to factoring the model artifacts and the generated code. Both of these approaches to factoring can be used in VB and C# solutions:

 

 

 

 

This is convenient for most cases as we expect that people will typically code against the classes instead of the entity client data provider.

 

Attaching and Detaching the Northwind Database

 

In order to use the samples, you need to attach the included Northwind database to the instance of SQL Server Express running in the Virtual PC image.

 

1.     Download the SQL Server Express Utility from http://www.microsoft.com/downloads/details.aspx?familyid=FA87E828-173F-472E-A85C-27ED01CF6B02&displaylang=en and run the installer inside the Orcas October 2006 virtual machine. Make note of the location where you extracted the files.

2.     Open a command prompt and cd to the directory where you extracted the ADO.NET samples and cd to the “Database” directory. It contains one file: NorthwindCTP.mdf.

3.     Run <path-to-sseutil>\sseutil.exe -m -a NorthwindCTP.mdf NorthwindCTP

 

If you want to reset the samples to their beginning state, you need to detach the database first and delete the log file:

 

1.     Open a command prompt.

2.     Run <path-to-sseutil>\sseutil.exe -m -d name=NorthwindCTP

3.     Delete the samples directory and extract the samples again from the zip file.

4.     Repeat the steps above to attach the database.