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 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.
Instantly test any C#/F#/VB snippet or program; Query databases in LINQ (or SQL) — SQL/CE/Azure, Oracle, SQLite & MySQL; Enjoy rich output formatting,.
This tool is called- 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! David Bauernschmidt I live in the historical triangle of Virginia where I am married with two daughters. I have spent over 13 years working for a Fortune 500 company in the computer area. I started in VB 6.0 and by the time I ended my employment I was supervising a development team where we built many web applications.
When my first daughter was born I wanted to spend more time with her so I left and became a programmer analyst for local government as well as launch my own company. Since then I have grown into a profitable web design and application company helping small businesses create a big presence on the internet. As an employee I have created web application used by citizens and other companies. I enjoy fly fishing, and spending time with my family.
I also enjoy learning new approaches and development tools when it comes to developing applications.
I’ve recently started giving a series of talks on LINQ based tools. While Visual Studio offers a lot in regards to support for LINQ, there are a number of mostly free tools that come in handy both from a usability and a learning experience. I gave a brief look at some of the tools as part of which should be airing on MSDN’s Channel 9 in early October.
In addition, I’m premiering the full presentation at this weekend’s. If you can’t make it out, feel free to try the tools on this list to see if they help you thinq LINQ. Also, let me know if I’m missing any tools that you think are worthy to be included in the list. Samples. (actually 404 samples in C# and another 303 in VB). – Visualizer to see what queries will be issued based on your LINQ to SQL Query.
You can also modify the generated SQL and preview the results. – Visualizer to see what queries will be issued based on your ObjectQuery (LINQ to Entities) query. You can also preview the results.
– Visualizer that shows you how the query is broken down into an expression tree. (Update: This only works with Visual Studio 2008. It is not supported in VS 2010). – Tool that allows you to copy sample XML into the clipboard and then paste it in C# Code using the functional construction syntax. Profilers. – Tool built into the SQL Server management tools that allows you to monitor all requests issued against the database including update statements in addition to the translated LINQ based queries.
– free, but $ if you want C# intellisense. A great tool to test and prototype LINQ queries. ($) – Profiler which extends the Context.Log functionality including performance and call stacks for the queries.
($) – Brought to you by the same team that does LLBLGEN (see below under designers). Works with any O/R mapper or data access layer using the DbProviderFactory, including:, Entity Framework v1, Entity Framework v4.x, Dapper.net, Massive, SubSonic, Microsoft.Data (WebMatrix).
Designers. – Alternative designer for EDMX files which allows you to break-up the model into digestible subsets of the conceptual model.
This is particularly helpful when working with models with many tables. ($) – Visual Studio add-in that helps to manage database schema changes and synchronize changes between the model and database. ($) – Designer originally built for the LLBLGEN OR/M, but now expanded to support EF, LINQ to SQL, and NHibernate. Worthwhile considering for large models that you need to break into manageable visual chunks. Code Gen. – T4 based code generation to replace the default code generated from the DBML file with LINQ to SQL.
– Code Smith code generation templates for LINQ to SQL which add capabilities not included in the code Visual Studio generates for DBML files. The templates themselves are free, but they do require a Code Smith license. For a limited time, you can get if you try PLINQO. Providers.
– Indexed LINQ to Objects project which can drastically increase your performance when querying LINQ to Objects. PLINQ – Parallel LINQ implementation coming in.Net 4.0. – Project which was going to give type safety and intellisense for C# over XML was released to codeplex to support the enterprise customers who were already using it since Microsoft decided not to continue enhancing it.
LINQ to REST – Client library included with.Net 3.5 sp1 used to write LINQ queries against Ado.Net Data Services to translate the LINQ query into the REST URI. – Sample LINQ provider against the Twitter and Twitter Search REST services. – Another sample LINQ provider, this time for the BING search engine.
– A must have tool if you want to build your own LINQ provider written by the mind behind LINQ to SQL. Again, I hope you find this list helpful and let me know any others that should be included here. If you’re looking for more developer’s tools, make sure to check out Scott Hanselman’s incredible collection at.