在生成事件中添加下面的代码:
IF $(ConfigurationName) == SQLGEN(NWR) "%PROGRAMFILES%\Microsoft SDKs\Windows\v6.0A\Bin\sqlmetal" /server:127.0.0.1 /database:databasename /user:admin /password:123456 /dbml:$(ProjectDir)LINQ\EProcess\NWR\NWR.dbml /sprocs /functions /entitybase:LINQEntityBaseIF $(ConfigurationName) == SQLGEN(NWR) "%PROGRAMFILES%\Microsoft SDKs\Windows\v6.0A\Bin\sqlmetal" /namespace:UOSPCore.LINQ.EProcess.NWR /code:$(ProjectDir)LINQ\EProcess\NWR\NWR.designer.cs /language:csharp /context:NWRDataContext /entitybase:LINQEntityBase /serialization:Unidirectional $(ProjectDir)LINQ\EProcess\NWR\NWR.dbml