SqlMetal.exe
• The SqlMetal command line tool can be generated by the. NET Framework's LINQ to SQL component.
Code and ing
• X: \ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ Bin
• Connection options
-/Server: <Name> specifies the name of the database server.
-/Database: <Name> specifies the database directory on the server.
-/User: <Name> specifies the logon user ID. Default Value: Windows authentication.
-/Password: <password> specifies the logon password. Default Value: Windows authentication.
-/Conn: <connection string> specifies the database connection string. Cannot match/server,/database,
Use the/user or/password option together.
-/Timeout: <second> specifies the timeout value when SqlMetal accesses the database. Default Value: 0 (no time limit
).
• Extraction options
-/Views: extract the database view.
-/Functions extract database functions.
-/Sprocs extract the stored procedure.
• Input options
-/Dbml [: file] sends the output with the. dbml extension. Cannot be used with the/map Option
.
-/Code [: file] sends the output in the form of source code. Cannot be used with the/dbml Option
.
-/Map [: file]: generate an XML ing file instead of an attribute. Cannot match the/dbml Option
Use together
• Miscellaneous options
-/Language: <language> specifies the source code language. Valid <language> include: vb,
Csharp. Default Value: Derived from the code file extension.
-/Namespace: <Name> specifies the namespace for the generated code. Default Value: None
Namespace.
-/Pluralize automatically applies the plural or singular form to the class and member names. This option is only available in
The English version is available.
• Example:
-Generate a dbml file containing stored procedures and functions (and automatically add multiple orders for class applications
Number Format)
-Sqlmetal
/Conn: "server = '(local)'; database = 'northwind '; uid = 'sa'; pwd = ''"
/Dbml: northwind. dbml/pluralize/sprocs/functions
• Generate code files
-Sqlmetal
/Conn: "server = '(local)'; database = 'northwind '; uid = 'sa'; pwd = ''"
/Code: northwind. cs/namespace: VS2008Demo6
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service