If you are like me and have worked for years building somewhat complex queries using t-SQL but are also trying to learn and use LINQ2SQL then you know that it can be frustrating. Frustrating because the syntax is different and learning curve is a little more than it should be. I also know that LINQ2SQL provides a lot of benefits that I should take advantage of.
I know of a great tool that converts linq to sql (LINQPad4) but I often wonder if there is a product that goes from sql to Linq. I found one such tool and must say it works very well. As with any conversion tool it does not always work flawlessly but the time it does save is worth the small cost.
This tool is called-Linqer
You can download the version and try it free for 30 days and you will quickly realize that it is worth the $60.00
Once you have installed it and created a new connection to your sql database. Then write your select statement in the left window and then click on the convert sql to Linq. The application will take your SQL statement and convert it to LINQ and also generate a class (they call it a template) that contains your result. This class includes all your properties and the generating of a function for you to add the records to. Below is a quick example of the tool.
From here you can copy the code into your project and start programming something more exciting.
You should change objects to actual data types in the class
Added Bonus: This tool will convert to C# or vb.net as well.
Looking for quality web hosting? Look no further than Arvixe Web Hosting!