Daniel's blog
SQL Server 2005 Express Edition and Reporting Services
18 June 09 08:56 AM | DanielVanWyk | with no comments

I found this list of articles by Marcin Policht on Database Journal that covers setting up Reporting Services on SQL Server 2005 Express.  I have yet to try Reporting Services on Express, but I really like Reporting Services in general.  The articles are detailed with links to all the places where you can download what you need.

Reporting Services can be used with SQL Server 2005 Express but the functionality is a bit limited.  You still have the ability to create reports and render them via the web, but additional functionality like Scheduling, exporting to XML, etc is not provided.

  1. Installing Reporting Services on SQL Server 2005 Express Edition
  2. Initial Configuration of Reporting Services on SQL Server 2005 Express Edition
  3. Basic Server Reporting Functionality in SQL Server 2005 Express Edition
Are you an Agile Fighter Pilot?
20 April 09 07:47 AM | DanielVanWyk | with no comments

In a recent blog post titled Agile, Agility, O-O-D-A, Dog fighting … what am I mumbling about today? Willy-Peter Schaub talks about O-O-D-A and how strategies from an exceptional fighter pilot translate into ideas for Agile IT.  It's always interesting to hear how other industries excel and learn from that.  Sometimes we're not as different as we think we are.

He also raises an interesting point about how we are trained as "solo pilots" but expected to work in teams.  One always needs a wing man, whether flying a fighter jet, prowling the local single scene, or coding.

Extensible Applications with the Managed Extensions Framework
30 September 08 07:41 AM | DanielVanWyk | with no comments

Brad Abrams has a post on his blog Simple Introduction to Extensible Applications with the Managed Extensions Framework that serves as a really good introduction and/or tutorial on how to use the MEF.

I love being able to extend your application by providing plug-ins / extensions. There are a couple of frameworks that provide similar functionality, so I guess it comes down to requirements and personal preferences when choosing one.  I'm very keen on trying the MEF out some time.

SA Developer.Net 2008 September Pictures
22 September 08 07:02 AM | DanielVanWyk | with no comments

The recent SA Developer.Net event in Cape Town was on Silverlight 2: The Developer's perspective. Nicholas Goossens presented a good talk that showcased how to do a CRUD grid with a nice detail-edit popup.  He even made some changes to the UI using Expression.  Check out his Nick's Blog for the presentation downloads, as well as some really interesting articles about testing.

My phone's battery died during the event, so I couldn't take any pictures.  Hilton took a picture that I uploaded.

<rant> I knew my Nokia E66 phone's battery was low, but I thought I would be able to recharge it with the USB cable (CA-101) which, according to their website, should be able to do it.  (And I checked, my phone is on the compatibility list) Alas!  I was mistaken.  Looks like I might have to get the CA-100 cable, or carry my charger around with me. *sigh*</rant>

SA Developer.Net 2008 August Pictures
17 September 08 07:25 AM | DanielVanWyk | 3 comment(s)

So, I finally got my phone connected to my laptop and uploaded the pictures to Flickr.  Check it out here:  SA Developer.Net 2008 August: Fight Night.

Uploading the files to Flickr was quite a pleasurable experience.  I was able to batch edit the pics to add descriptions and tags.  I could also drag and drop them into a set.  All this time it never felt like I was using a web application.  Flickr impressed me today.

I'll upload the pictures of tonight's event (17 September 2008 - Silverlight 2: The Developer's Perspective) faster.

Filed under:
Whirlwind Videos: What's new in C# 2 and C# 3
04 September 08 10:41 AM | DanielVanWyk | with no comments

Rihan pointed me to this cool section on channel9 that has "whirlwind" videos about what's new in C#2 and C#3. 

Spread the love!

"Bruce Kyle of Microsoft and Stuart Celarier of CheckFree explore the new languages features in C#. It's a whirlwind tour of the important language features since C# 1. Stuart describes the feature and why it is useful. But doesn't get into best practices nor suggested usages. Just the facts about the feature.

Whirlwinds are bite-sized webcasts, each is shorter than 15 minutes. You can start anywhere in the series to learn about the parts you're most interested in."

What's new in C# 2

What's new in C# 3

Other videos of interest

Filed under: ,
SQL Server: "list-type parameters" from 2000 to 2008
11 August 08 06:58 AM | DanielVanWyk | with no comments

Sometimes one has to send a "list of things" as a parameter to a stored proc, like a list of CustomerIds that need to be updated, or a list of ProductIds that should be hidden, etc. 

Some of the ways to do this:

  • Call the stored procedure for each id from the client code.  This is not ideal because it results in (possibly) many database hits.
  • Pass the list as a csv-type string and then loop through the values in the list in your stored proc
  • Pass the list as a csv-type string and use a function that translates this into a table which you can join on. 

Converting the list to a table is a good idea and you can find a way of doing it on this blog post:  SQL SERVER - UDF - Function to Convert List to Table  I prefer this approach.  The mechanics of looping and delimiting is abstracted and you don't have to re-code it every time.  In SQL 2005 you can join on a table returned by a function, which makes SET-based operations possible.  For example: You can do an inner join between the customer table and this table to get a list of all customers that should be updated.

SQL Server 2008 provides another option:

  • Pass the list as a table

You can read about it here:  SQL Server 2008: Table Valued Parameters  This article is a really good explanation of what you need to do to enable it, and also what you need to do to use it from SQL Code and from .Net code.  The "trick" is to create a new "User-Defined Table Type", similar to a "User-Defined Type".

I wonder how nHibernate (and other ORM tools) and LINQ-to-SQL will handle this.  Guess I have a weekend project coming up to test it!

Scripting objects in SQL Server 2005: DROP it already
08 August 08 06:14 PM | DanielVanWyk | 1 comment(s)

I had to create scripts for a couple of Stored Procedures today.  SQL Server Management Studio provides that functionality: 

So, then why the reason for the post?  In Enterprise Manager (in the bygone days of SQL Server 200) you could also script objects using a similar "scripting wizard".  The scripting tool had one big advantage:  you could add DROP statements that would check if the object exists and then drop it before creating it. 

I don't particularly like scripting objects out of the database.  Instead, I usually add objects (and data) to the database by creating a script.  Those scripts can then be used on another database.  But sometimes your finger isn't the only finger in the pie, and you have to script them.  Ce'st la vie :)

Googling around helped me find this awesome tool:  Scriptio.  You can read about it here:  Scripting Objects in SQL Server 2005. The blog entry also includes a link to download the source code.  It runs using ClickOnce and allows you to do a multitude of scripting wonders.  So, now I could script those stored procedures and have a wonderful IF EXISTS ... DROP statement before the CREATE statement.

Thanks Scriptio!

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:
A dialog box is open. Close it and try again.
30 June 08 08:39 AM | DanielVanWyk | 10 comment(s)

I recently had to set up a new laptop with all the development tools and other applications.  This in itself isn't so bad, it just takes some time.  This was also my first hands-on experience with Vista, and Vista 64-bit nonetheless.  It made for some pretty interesting driver searches and downloads and in the end all worked out fine.

With the exception of Outlook 2007.  I opened Outlook and it created an account to the Exchange server.  All seemed well and Outlook even downloaded my email from the Exchange server.  Outlook even allowed me to read my emails.  However, I could not compose new emails, nor could I reply to the ones I read.  Every time I tried, I would get this error message:  "A dialog box is open.  Close it and try again."

image

Searching for this dialog box was unsuccessful.  No amount of Alt-Tab, or switching to Outlook from the task manager would show it.  Of course I moved the actual Outlook window around also, but nowhere was there a sign of a dialog window.  I closed all applications and tried to close Outlook also, but was greeted with the same error message.  I had to stop the application using the TaskManager.  I rebooted and tried a number of times, all to no avail.

Thus I Googled and found this article:  Hidden dialog box in Outlook 2007 problem.

This forum post was spot on.  It turns out that every time Outlook started, it tried to create a new account for me.  During this process a dialog box showed that asked my name and Initials, but it was hidden immediately.  The advice from the post helped me out:

I ran into this same problem today. Upon starting Outlook 2007 after loading a new account I received this error. I believe the dialog box being hidden was where it asks for users initials and name as it flashes fast and you cannot click ok.
To get past this I opened another program in the suite such as Word 2007 where that same dialog box pops up. I enter the information and clicked ok and that appears to be universal throughout the whole suite. I then got back into Outlook and I could perform the necessary functions.

Another poster commented:

I had the same problem with Outlook and the hidden "Name and initials" dialog box on new profiles. It was caused by the recent Outlook patch KB946983. Removing it fixed the problem.

Reading through all the posts is quite interesting.  Also, for future Outlook patch/upgrade issues, you can check out the Office Sustained Engineering blog of "the team behind Office hotfixes, security updates, and service packs".

Filed under: ,
Let the games begin!
12 June 08 01:12 PM | DanielVanWyk | 4 comment(s)

Hello world.  Here I am! 

After Googling and using other people's blogs so much it will be bad karma if I don't return the favour.  I'm looking forward to posting some of the stuff I learn or have questions about, good discussions and collaborations.

I've heard so much about Windows Live Writer and fortunately this blog seems to support it.  (I'm typing this entry in Windows Live Writer.)  Installing Windows Live Writer wasn't difficult at all.  You can get it here.  The setup was rather easy as well and I just followed the wizard.

LuckyLuke