9 Apr 2009

SqlMetal + Visual Studio Jollity

Whack the following code in a .bat file, register it with Visual Studio's "External Tools" under the Tools menu, and call it whenever you want to regenerate your LinqToSql ORM goodness:

@ECHO OFF
ECHO # GENERATING "MyProject.Classes.ORM" CLASSES - THEY MUST BE CHECKED OUT FOR THIS TO WORK!
ECHO.

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\SqlMetal.exe" /server:localhost /database:MyProjectDB /code:MyProject.Classes\ORM\MyProjectDBContext.cs /namespace:MyProject.Classes.ORM /pluralize

ECHO # GENERATION COMPLETE - CHECK ABOVE FOR ERRORS

No comments:

Post a Comment

Comments are very welcome but are moderated to prevent spam.

If I helped you out today, you can buy me a beer below. Cheers!