I <3 Linq
Posted on June 3, 2008
Filed Under linq
One of the latest technologies to hit .Net recently is Linq. Language Integrated Query allows you to perform a more SQL like syntax on object collections in code. It has been out for quite some time, but I just recently was able to use it in a project. It’s pretty cool stuff and has already saved me a few lines of code. Places where loops would have been neccessary have easily been replaced with a simple where.
One of the concerns most developers had, especially when working with Linq to SQL data classes, was the relative speed at retrieving data from the SQL server. They were pretty right about that. It’s slow. Much slower than even using datasets with table adapters. However, using compiled queries can help.
One thing some people never took into consideration was the relative ease that Developer’s Express users can now use server mode without having to use the proprietary XPO classes. Their XtraGrid’s now support ServerMode which will page SQL queries in windows forms applications. One issue we had were slow VPN clients trying to use a windows form application installed locally and connecting to a remote SQL Server. Until recently we have had to tell users to use terminal services instead. Some forms have to show a relatively large amount of data in a single grid (finding customers, paging through certain data, etc). Over a VPN connection it was just painfully slow. Now combining XtraGrid’s and the Linq Server Mode, everything works as expected over a slow (1.5 MB DSL even) VPN connection.