How do we mention the Table information in the command when we want to generate the external mapping file directly from the database. We have the /Database option but how do we mention the table information
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t use SqlMetal to specify which tables in a database to generate mapping for – it’s all or nothing, unfortunately.
You could use SqlMetal to generate a DBML file for the database first, then filter out <Table> elements in the DBML file as needed, using a custom process you write yourself. A DBML file is just an XML file that matches the DBML schema, so it’s easy to manipulate using LINQ to XML, for example.
Once the DBML file is ready, you can pass it to SqlMetal again to generate code and an external mapping file.