Home | Blog | Publications | Photos | Services | About | Contact

Blog Archive - September, 2008

Back to Blog index.

Tue, 30 Sep 2008 17:15:51 GMT:
New article: Getting Up and Running with the Composite UI Application Block for WPF

Developer.com hosts my newest .NET and C# development article titled "Getting Up and Running with the Composite UI Application Block for WPF ", which talks about the CAB block for Windows Presentation Foundation applications.

Enjoy reading, and let me know what you think!

Mon, 29 Sep 2008 15:16:38 GMT:
Visual Studio 2010 and .NET 4.0 announced

Only few hours ago, Microsoft announced the next version of both Visual Studio and .NET Framework. The next versions will be called Visual Studio 2010 and .NET Framework 4.0.

The press release nicely outlines the new features, but there's also completely new page on MSDN devoted to the new version.

Great reading, so be sure to check it out today!

Mon, 29 Sep 2008 14:48:54 GMT:
SQL Server 2008 Experience, what is it?

If you are a fan of SQL Server, then the chances are you are interested in SQL Server 2008 as well. Microsoft has just recently (yesterday, in fact) announced a new site called the SQL Server Experience, available at www.sqlserverexperience.com.

The site connects you with videos from the SQL Server Engineering team, and while doing so, you learn about the internals of the product. The fun side's also there.

Fri, 26 Sep 2008 14:35:11 GMT:
Silverlight 2 RC0 now available

Microsoft yesterday announced that Silverlight 2's first Release Candidate (RC) is now available. This means that the "SL2 RC0" can now be downloaded here.

New features include numerous API changes (some breaking), new controls, and improved skinning.

Tue, 23 Sep 2008 15:22:56 GMT:
How to enable SQL Server tracing

If you are developing applications for Microsoft SQL Server, or need to maintain such a server, you might want an utility to monitor those SQL statements that your (own) applications execute against the database server.

Luckily, SQL Server supports an utility (in SQL Server 2005, anyway) called SQL Profiler, which supports traces. When you launch this utility from the Start menu, you can go to File/New Trace, and then hit OK. Once you do this, the screen will start to display information about all SQL statements executed or run against the database server in question. Yes, it's that easy!

Microsoft's KB article 224587 gives additional details. Keywords: How to enable tracing in Microsoft SQL Server, HOWTO, tracing, monitoring SQL statements.

Sun, 21 Sep 2008 17:21:45 GMT:
Quick reminder: SELECT queries and NULL values in SQL Server and C#

When you are developing database application, handling NULL values can sometimes cause trouble. For instance, it is a common mistake to construct SELECT queries like this with SQL Server, if you are not paying attention:

SELECT [nn], [mm]
FROM [table]
WHERE ([somefield] = 'ABC') AND ([someotherfield] = NULL)

Can you spot the mistake? This query never returns the correct values, because the NULL value has been specified incorrectly. Of course, the remedy is to use the "IS NULL" construct instead, like this:

SELECT [nn], [mm]
FROM [table]
WHERE ([somefield] = 'ABC') AND ([someotherfield] IS NULL)

This query would then return the correct values. But, as an C# application developer, you might already be using parameterized queries, with code similar to this (error checking omitted for clarity):

SqlConnection conn = new SqlConnection(
  Properties.Settings.Default.MyConnectionString);
conn.Open();
string sql = " SELECT [nn], [mm] " +
  "FROM table " +
  "WHERE ([somefield] = @somefield) AND "+
  "([someotherfield] = @someotherfield)";
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.AddWithValue("@somefield", "ABC");
cmd.Parameters.AddWithValue("@someotherfield", DBNull.Value);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
  MessageBox.Show(reader.GetString(...));
}
reader.Dispose();
cmd.Dispose();
conn.Dispose();

Here, the code uses two named parameters in the SQL query: @somefield and @someotherfield. But, the code then calls the Parameters.AddWithValue method with the value of DBNull.Value.

If you don't know how the SQL Server driver executes this statement, you might be inclined to think that the WHERE parameter is executed like this:

...
WHERE ([somefield] = 'ABC') AND ([someotherfield] = NULL)

However, for some reason, the query still works as expected. How can this be? The answer is the fact that the SQL statement isn't in fact executed directly, but instead using a stored procedure called "sp_executesql". If you enable SQL Server tracing (more about this in a forth-coming blog post), you can see that a statement like this is executed:

exec sp_executesql N' SELECT [nn], [mm] FROM
table WHERE ([somefield] = @somefield) AND
([someotherfield] = @someotherfield)',N'@somefield
nvarchar(3),@someotherfield nvarchar(4000)',
@somefield=N'ABC',@someotherfield=NULL

As you can see, in this case it doesn't matter that the @someotherfield is NULL! By using the "sp_executesql" stored procedure, the SQL Server ADO.NET driver cleverly walks around the issue, and doesn't need to resort to actually changing the SQL statement if the parameter value is NULL.

Thu, 18 Sep 2008 16:50:43 GMT:
Feature ideas for Visual Studio 10 start to emerge

Visual Studio 2008 has been here for a while now, and the next version of Visual Studio will eventually be here. Just recently, public details of Visual Studio 10 (or "VS10") are starting to emerge. The VSX Conference in USA has been held, and things talked there are summarized in a blog post by Jeffrey Schlimmer.

Interesting features are, among others, a WPF-based code editor (!), the focus of a smaller and faster IDE, integrated IM client (Instant Messaging, think Live Messenger), and setup improvements.

Sounds like plenty of interesting things. The keys are: "Experience", "Customer", "Platform" and "Architecture".

Wed, 17 Sep 2008 16:20:06 GMT:
Canon announces EOS 5D Mark II

Canon has announced the anticipated second incarnation of the familiar EOS 5D: EOS 5D Mark II.

The new camera has a 21 megapixel sensor, HD video recording possibility (on a DSLR?) up to around 10 minutes, expanded ISO range, and more. Sounds like a great little camera to me!

Wed, 17 Sep 2008 16:01:03 GMT:
QuickStart to ASP.NET Model-View-Controller Applications

Are you interested in learning more about the new ASP.NET's new MVC (Model-View-Controller) technology? The familiar asp.net web site is a good starting point, and now the site features nice QuickStart tutorial and videos about the new technology.

For example, there are topics like "ASP.NET MVC Overview", "ASP.NET Routing", filtering, and unit testing, among others.

Check them out!

Sun, 14 Sep 2008 18:42:05 GMT:
Where to get the Windows Installer CleanUp Utility?

Sometimes, when you try to uninstall a program from your system, you notice that it won't uninstall. Or, the application might uninstall, but still leave an entry to the depths of the system registry, and thus lingers on the list of installed applications forever.

Luckily, Microsoft has developed an utility called the Windows Installer CleanUp Utility to cover such situations. By downloading the packet msicuu2.exe and installing it, you get a nice little tool for forcibly removing unnecessary items from the Windows Installer database.

The standard disclaimer of course applies: just like with RegEdit, be careful with msicuu.exe! A wrong click, and trouble could result. After you understand the implications, it's a nifty little app worth checking out.

Thu, 11 Sep 2008 12:00:23 GMT:
Microsoft WebDays 2008 is coming on 16th of October

Microsoft Finland arranges two popular developer events in a year: the larger DevDays in the spring, and the WebDays in the autumn. Now it is time for WebDays: they are being held on 16th of October here in Helsinki.

I've been asked to keep an ASP.NET session there, hope you can attend!

Update on 17th of September: the registration site is now open.

Mon, 08 Sep 2008 04:43:38 GMT:
New column in the Finnish Prosessori magazine

The Finnish Prosessori magazine features my newest .NET development column, titled "Uuden opiskelu vastaa siirtymistä 32-bittisyyteen".

The column talks about the new features of .NET 3.0 and 3.5, which in my opinion requires extensive studying to be thoroughly understood and put into effective use. I've also updated my Publications page to reflect the lately published articles.

Sat, 06 Sep 2008 15:49:09 GMT:
.NET Reflector changes owner/developer

Most .NET developers are familiar with Lutz Roeder's venerable .NET Reflector utility. This utility, part of my toolkit also, has been eight years in the making, and now the author reports that its time for him to move on.

Luckily, development won't stop here, and Lutz reports that he has "reached an agreement to have Red Gate Software continue the development of .NET Reflector."

Sat, 06 Sep 2008 14:00:15 GMT:
Windows Small Business Server 2008

While I was on my vacation, Microsoft announced the future availability of Windows Small Business Server 2008, or SBS 2008. The official launch date is now locked to November 12th, which is soon here if days go as fast in the future as they have in the past two months.

Developers targeting this operating system edition can assume similar features as Windows Server 2008 and Exchange Server 2007 combined, optionally with SQL Server 2008 installed. Of course, you could also detect specifically, if the Windows OS version is a SBS server.

Fri, 05 Sep 2008 18:01:25 GMT:
On vacation in USA

I spent the last week or so in western part of the U.S., and so haven't been able to keep up with regular postings.

I visited Los Angeles and Las Vegas, a nice trip.

 

› Blog Archive