Building a Data Access Layer with a User-Defined Type
In this final section, let’s actually do something with our new user-defined type. We create a new data access component that uses the DBMovie
class and an ASP.NET page that interfaces with the component.
Before we can do anything with the DBMovie type, we need to add a reference to the DBMovie.dll
assembly to our application. In Visual Web Developer, select Website, Add Reference, and browse to the DBMovie.dll
. Alternatively, you can create an application root Bin folder and copy the DBMovie.dll
into the Bin folder.
Our new data access component is contained in Listing 19.37.
Listing 19.37. App_Code\DBDataLayer.cs
The component in Listing 19.37 contains two methods: GetAll()
and Insert() ...
Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.