Creating User-Defined Types with .NET Framework

You can create a new user-defined type by creating either a .NET class or .NET structure. After you create a user-defined type, you can use it in exactly the same way as the built-in SQL types such as the Int, NVarChar, or Decimal types. For example, you can create a new type and use the type to define a column in a database table.

To create a user-defined type with the .NET Framework, you must complete each of the following steps:

  1. Create an assembly that contains the new type.
  2. Register the assembly with SQL Server.
  3. Create a type based on the assembly.

We go through each of these steps and walk through the process of creating a new user-defined type. We create a new user-defined type named DBMovie ...

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.