CodeGenerate tool (sqlmetal.exe)
The sqlmetal command line tool can generate code and ing for the. NET Framework's LINQ to SQL component. By applying the options next to this topic, you can instruct sqlmetal to perform several different operations, including:
Generate from databaseSource codeAnd ing properties or ing files.
Generate an intermediate database Markup Language (. dbml) file for custom use from the database.
Generate code and ing attributes or ing files from the. dbml file.
By default, the sqlmetal file is locatedDrive: \ Program Files \ microsoft sdks \ windows \ vN. nn\ Bin.
Http://msdn.microsoft.com/zh-cn/library/bb386987.aspx
EDM generator (edmgen.exe)
Edmgen.exe is a command line tool used to process the Entity Data Model (EDM. You can use the edmgen.exe tool to perform the following tasks:
By using the. NET Framework data specific to the data sourceProgramConnect to the data source and generate the ing (. MSL) files used by the conceptual model (. CSDL), storage model (. SSDL), and EDM. For more information, seeHow to: Use edmgen.exe to generate an object data model (Entity Framework).
Verify the existing model. For more information, seeHow to: Use edmgen.exe to verify the Object Data Model.
Generate a C # Or Visual Basic code file containing the object class generated from the conceptual model (. CSDL) file. For more information, seeHow to: Use edmgen.exe to generate an object model file (Entity Framework).
Generate a C # Or Visual Basic code file that contains the pre-generated view of the existing model. For more information, seeHow to: Pre-generate views to improve query performance (Entity Framework).
The edmgen.exe tool is installed in the. NET Framework directory. In many cases, it is located in c: \ windows \ Microsoft. NET \ framework \ v3.5. You can also access the edmgen.exe tool (click"Start", Pointing"All Programs","Microsoft Visual Studio 2008","Visual Studio Tools"And then click"Visual Studio 2008 command prompt").
Http://msdn.microsoft.com/zh-cn/library/bb387165.aspx
Use: generate the entire entity model.
Edmgen/mode: fullgeneration/provider: system. Data. sqlclient/C: "Server = servername; database = northwind; Integrated Security = true"/Project: northwind