Search code examples
c#.netlinqlinq-to-sqlsqlmetal

I can setup LINQ to SQL in VC2010 fine, so why is SQLMetal relevant?


I am new here so hello.

I am using ASP.NET 4 and I am using LINQ to SQL for my data controls. As advised I create a DBML (LINQ to SQL Class Item) and then drag on the relevant tables from SQL Server. I then use this DBML in my code with LINQ ie:

        using (ProjectDataContext Data = new ProjectDataContext())
        {
           Order MyOrder = new Order();


        }

and this all works fine. I have now come across SQLMetal. I cannot see the relevance of this tool, am I missing something?

Thanks,

Ed


Solution

  • As you've used the wizard to drag the tables across from SQL, that has in turn generated the objects for you, so there is no need for SQLMetal.

    SQLMetal is a command line tool that you could have used in order to generate these objects from linq to sql, but it's far easier to just drag and drop them in the wizard. It also has it's other uses. For reference, see here: http://msdn.microsoft.com/en-us/library/bb386987.aspx