July 2008 - Posts - Daniel's blog

July 2008 - Posts

SA Developer.Net July Event: LINQ to SQL
31 July 08 11:24 AM | DanielVanWyk | 3 comment(s)

The monthly SA Developer.Net (Cape Town) event was last night at the Microsoft Office and Hilton spoke about LINQ to SQL.  There were quite a lot of people who have used LINQ by now and there were some really good conversations. 

Some key take-aways for me:

  • The generated classes are partial, and thus not sealed, and you can add  your own properties and/or business logic separately from the generated code. 
    • This means that you can make your classes Serializable simply by adding the [Serializable] attribute at the top of your partial class.
    • If you add your own properties, they cannot be used when creating your LINQ statement.
  • With great power comes great responsibility.  Just because you're using LINQ to SQL doesn't mean you don't have to care about HOW you're using it.  It is possible to create hordes of database hits with careless blasé use.  It is also (usually) possible to consolidate those hits into one hit by specifying the correct LoadOptions.
  • Once you've dragged a table on to the designer changes to the database will have to be incorporated manually.

One of the interesting conversations was about where to fit LINQ to SQL in architecturally, and especially if you use webservices.  There are obviously as many ways of dealing with this as there are ways to enjoy a lazy Sunday Morning, and it's always interesting to hear what other people think. 

I can't help but wonder though:  "Why should a developer care if they're coding to a SQL 2005 or a SQL 2008 database?".  It seems that LINQ to SQL abstracts the database sufficiently enough that you only need to care about the "concepts" in the database.  To some degree this feels similar to how Silverlight and Expression abstracts design and coding. 

Someone mentioned that in their project they reduced their stored procedures from over 500 to about 3.  There are cases when you need to do something in the database and that's when you'll use Stored Procs and/or Functions. Glad to see that there is still some place in the sun for Stored Procs.

No matter how often I use LINQ, it stays amazing.  It sometimes makes me feel like I'm Neo (from the Matrix) walking through my data.  One of the really cool things about working in database code is that you can work with SETS of data and perform SET BASED operations.  LINQ (in general, not just LINQ to SQL) brings this power to your "run-of-the-mill" development.  Awesome stuff.

Filed under: ,
Download SQL Server 2005 Express
18 July 08 06:57 AM | DanielVanWyk | 1 comment(s)

People often ask me where to download SQL Server 2005 Express and/or SQL Server Management Studio Express.

The official SQL Server Express 2005 Download page contains all the links you might need, and much much more.  Here are shortcuts to the direct downloads:

Remember to install the .NET Framework 2.0 (or later) for SQL Server 2005.

If you are looking for the ultimate download, you can download the SQL Server 2005 Express Edition with Advanced Services SP2.  It's a hefty 234 MB download, but contains the database engine, SQL Server Management Studio Express, Reporting Services and Full-text search. 

The Microsoft SQL Server 2005 Express Edition Toolkit (223.9 MB) contains tools you can use to be more productive in developing solutions on SQL Server 2005 Express.

SQL Server Express Toolkit provides tools and resources to manage Microsoft SQL Server 2005 Express Edition, and to create reports by using SQL Server 2005 Reporting Services. The kit includes Connectivity Components, Business Intelligence Development Studio, Management Studio Express, and a Software Development Kit. To create reports by using Reporting Services, you must use Business Intelligence Development Studio.

There is also a link to the SQL Server 2005 Samples and SQL Server 2005 Books Online.  The SQL Server Books Online is an invaluable tool for anyone doing work on SQL Server.  It covers topics ranging from how to write a SELECT statement, to various replication methods, using CLR in SQL, etc.

LINQ: useful links
01 July 08 08:06 AM | DanielVanWyk | with no comments

I found these links and thought I'd spread the love.

Filed under: