Archive for the '.net' Category

Sending the LINQ To SQL log to the debugger output window

I was playing with LINQ To SQL (again) this evening, and I thought: why can’t I see the generated SQL statments in my debugger output window?

The DataContext.Log property is a great help to learn writing LINQ To SQL queries. All you need to do is assign a TextWriter to it, and you get to see al the SQL statements generated by the data context. But where do you send them to? Console.Out is an option, but you probably don’t want that in a release build. Furthermore, it doesn’t quite work for Windows services or ASP.NET applications. That’s why I wrote DebuggerWriter, an implementation of TextWriter that writes to the debugger log.

Find the code at my U2U Blog.

Compiling Regular Expressions

Update your bookmarks, new posts on .NET related stuff will be posted to http://www.u2u.info/Blogs/Kris/. The first new one to appear there is all about compiling regular expressions in .NET, with a free compiler tool to download. Enjoy reading.

WPF/E preview and new Expression designers released

Microsoft released the first CTP for WPF/E, short for Windows Presentation Foundation/Everywhere, a WPF subset to run in browsers (Firefox and IE on Windows, Firefox and Safari on the Mac). Broadly available for customers in the first half of 2007, “WPF/E” experiences will require a lightweight browser plug-in made freely available by Microsoft.

Just in case you haven’t figured out yet who they are competing against, Michael Swanson released a free Macromedia Flash to WPF/E converter

Also this week, Microsoft released Expression Blend Beta 1 (formerly known as Expression Interactive Designer, a graphical WPF XAML editor) and Expression Design December 2006 CTP (formerly known as Expression Graphic Designer).

Expression Blend looks good, though the first thing I did was change the default dark theme to the light theme, and decrease the workspace zoom to 90%. I need a bigger screen…

Paint.NET V3 Beta 1 available

Rick released the first beta for Paint.NET V3. This version is now feature complete, and all known bugs have been fixed. The coolest new feature in this release is a Perlin noise based clouds renderer, with – as usual – a very easy to use configuration panel.

I’d say it’s about time you uninstall that cracked Photoshop!

Linq to XSD preview released

Last Monday, the Microsoft XML Team released the first Linq to XSD preview.

While the LINQ to XML programmer operates on generic XML trees, the LINQ to XSD programmer operates on typed XML trees — instances of .NET types that model the XML types of a specific XML schema (XSD). […] LINQ to XSD is integrated into Visual Studio; so you just tag an XML schema as [a] ‘LINQ to XSD schema’, build your project, and the automatically derived object model is then part of your solution — just as if XML schemas were .NET types.

I only had a quick look, but I have to say it looks very promissing! Send them your feedback, but hurry, I want this to be included in Visual Studio Orcas.

Creating a Data Access Layer with Linq to SQL, part 2

Last time, we looked at how Linq To SQL might impact how we think about what a Data Access Layer (DAL) is, based on the dependencies between assemblies. This time, we’ll take a different approach: let’s look at typical Linq to SQL code, and try to decide where to put it. I’ll use a code sample from the “DLinq Overview for CSharp Developers” document included in the Linq May CTP (in C# 3.0, but the same applies to VB9).

Continue reading ‘Creating a Data Access Layer with Linq to SQL, part 2’

Amazing XAML

Since the .NET Framework 3.0 has been released, the interest is Windows Presentation Foundation (WPF) and XAML is growing. A good understanding of XAML and how it works is essential to understand WPF. A while back, Peter Himschoot wrote an excellent article about it: Amazing XAML.