Generate a .dbml file that includes extracted SQL metadata:
sqlmetal /server:myserver /database:northwind /dbml:mymeta.dbml
Generate a .dbml file that includes extracted SQL metadata from an .mdf file by using SQL Server Express:
sqlmetal /dbml:mymeta.dbml mydbfile.mdf
Generate a .dbml file that includes extracted SQL metadata from SQL Server Express:
sqlmetal /server:.\sqlexpress /dbml:mymeta.dbml /database:northwind
Generate source code from a .dbml metadata file:
sqlmetal /namespace:nwind /code:nwind.cs /language:csharp mymetal.dbml
Generate source code from SQL metadata directly:
sqlmetal /server:myserver /database:northwind /namespace:nwind /code:nwind.cs /language:csharp
Note: |
|---|
When you use the
/pluralize option with the Northwind sample database, note the following behavior. When SqlMetal makes row-type names for tables, the table names are singular. When it makes DataContext properties for tables, the table names are plural. Coincidentally, the tables in the Northwind sample database are already plural. Therefore, you do not see that part working. Although it is common practice to name database tables singular, it is also a common practice in .NET to name collections plural.
|