DLinq and SqlMetal

Posted Monday, May 29, 2006 8:39 AM by Maurice
One of the problems I am always having with database development is the gap between data and code. Sure it isn’t hard to move data from database to memory, manipulate it and move it back but what remains a drag is someone making schema changes to the database and only finding out at runtime that the classes no longer match the underlying database schema.

Well there might me light at the end of the tunnel :-)

One of the features of DLinq is a command line utility called SqlMetal. Using this tool you can generate the types required for DLinq to work. Basically it generates a large source file, depending on the command line parameters, that you can include in your project. Now suppose you add this command line utility to the Visual Studio projects pre-build event? This way you will always have an up to date set of entity objects matching the database schema and you will get compile errors as soon as you change the database schema.

Update: See http://msmvps.com/blogs/theproblemsolver/archive/2006/05/30/97708.aspx for an example.

Maurice de Beijer
www.TheProblemSolver.nl

Filed under: ,

Comments

# re: DLinq and SqlMetal

Thursday, August 31, 2006 1:23 PM by Kasper

Hi,

I have written a small report about DLinq and LINQ.

SQLMetal creates the object representation of you relation database schema, however there are a bunch of problems regarding this. Since the relational world does not have any notion of inheritance etc. this will not be mapped into the object created from SQLMetal. However DLinq is also capable to create the relational database from the outset of the object, hence you could create your object hierarchy and then let DLinq create the relational database. I look into this and a lot of other stuff in a resent project I have been writing. You find it at: http://www.dlinq.dk/DLinq.html

# re: DLinq and SqlMetal

Monday, February 18, 2008 2:06 AM by User Interface for SqlMetal

There is a third party tool available which provides User Interface for SqlMetal. This tool have features like project managment and error checking.

sourceforge.net/.../sqlmetalbuilder

Leave a Comment

(required) 
(required) 
(optional)
(required)