-
-
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.
-
-
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.
-
-
I found these links and thought I'd spread the love.
- 101 LINQ Samples
This web page from MS contains a slew of LINQ samples. Check out this web page if you need examples. There are samples on Grouping Operators, Set Operators, Projection Operators, and many more.
- Demystify LINQ in 10 minutes
This article explains the evolution of C# focusing on LINQ. When you read it like this, it makes sense that LINQ was the next step. The article also references the video of Alex Turner showing the evolution of C# on channel9.
- Links to LINQ (Charlie Calvert's Community Blog)
Check out all the links on this page and you might feel like a kid in a candy store. There are links to official MS sites on LINQ (including the 101 LINQ samples page), other blogs. There are also links to other LINQ providers, ranging from Amazon, Active Directory, to NHibernate, Google. I'm an Excel fan, maybe one of it's biggest fans, and when I saw the link to Excel.Linq my heart possibly skipped a beat.
- Hilton's Blog
Hilton turned on the light for me on LINQ, and since then I've been coding in technicolor! I especially found these posts useful: Linq Query Operators 'Cheat Sheet', Getting Started With LINQ to SQL and More LINQ Links
- LinqDataSource with ASP.NET data controls
A series of articles on CodeProject that steps you through using LINQ on an ASP page. The first article is especially good for beginners.