Visual studio Tip #5: “Surround with…” in ASP.NET 4.0

As an ASP.NET developer, you certainly found yourself in the following situation.
You have a number of mark-up elements in your page which should be hidden/updated/… all at once.
The solution is to put them in a panel or updatepanel.

In previous versions of Visual Studio you had to manually type the tags to surround your mark-up with, causing a lot of copy pasting and scrolling sometimes.
Visual Studio 2010 now offers the “Surround with…” option in your ASP.NET mark-up.
We already knew this feature from VB.NET or C#.

Let’s say you have a panel which has to be placed in an updatepanel:

After selecting the panel mark-up you can right click on it (or use the shortcut CTRL + K, S) to show the following context menu:

You can chose which snippet needs to be used for the surrounding.
Selecting the “updatepanel” snippet gives the following result:

It’s just a small feature, but it should already have been in Visual Studio for a long time!

Visual studio tip #4: Generate method stub in VB.NET 2010

I am not a big fan of VB.NET, but for some reasons I will not explain in this post, I have to code in it (lucky me :-) ).
Microsoft is always claiming that C# and VB.NET are equally evolving, but some changes only appear in VB.NET one or more releases after they have been implemented in C#.
In C#, previous versions of Visual Studio already offered the ability to generate a method definition that didn’t exist already.
In VB.NET you had to write your method stubs first by yourself.
The little dash that appeared under your method didn’t know what to do with it in Visual Studio 2008:

Visual Studio 2010 now offers a change. Typing CTRL + . or clicking on the little dash now results in this:

When you click on generate, this results in a method definition which is basically the same than in C#:

I was always wondering why Microsoft didn’t implement this feature in previous releases, but finally it’s there!
Only one thing that annoys me is that the little dash doesn’t pop up directly while you are typing, as in C#.
If you are coding VB.NET you have to put your have to move your cursor to another line (or something else that changes the focus of the current line)   before Visual Studio wants to help you.
As I work in a mixed environment, I must say the intellisense and little help features as the one described above are still better implemented in C#, but you can’t always compare both languages as the syntax is totally different.

Office 2010: choose your default open standard

Where Office 2007 introduced Microsoft’s new Open XML format, Office 2010 (which RTM’d last week) goes even further in its support for open standards.
When you first open an application from the Office 2010 suite: the following window appears:

Microsoft definitely adds more flexibility with this feature, enabling Open Office users to open their ODF files in Microsoft Office and vice versa.

No Business Intelligence Development Studio in Visual Studio 2010 (yet?)

As a developer I am pleased with the new Visual Studio 2010 release.
Lots of features were added and the editor looks more tight and solid than its predecessors.

BI people still have to wait to taste the Visual Studio 2010 candy.
SQL Server 2008 only ships the Business Intelligence Development Studio (BIDS) for Visual Studio 2008, which is understandable because Visual Studio 2010 didn’t exist when SQL Server 2008 was released.

Enthusiastuc BI users who wanted to convert there existing reporting project to a Visual Studio 2010 project already reported (here and here) that the conversion failed.
The official statement from Microsoft:

Business Intelligence Development Studio for Visual Studio 2010 is currently under consideration for future releases of SQL Server.

So we can only hope that SQL Server 2008 R2, which was released on May 3 on MSDN will (probably?) be released at May 21, will ship BIDS 2010, although I just can’t find an official statement from Micrsosoft on that, so we have to wait until May.

UPDATE: Just downloaded and installed the SQL Server 2008 R2 Business Intelligence Development Studio. Unfortunately it only works in Visual Studio 2008.

Visual Studio tip #3: hide splash screen

Splash screens are beautiful, at least that’s wat Microsoft thinks about it.
I must say, splash screens are just annoying and they slow down the startup of Visual Studio and other programs.
But, there is a way to skip the splash screen part in Visual Studio.

Most of  the Visual Studio developers launch their favorite development platform using a shortcut.
Depending on the version of Visual Studio, the shortcut refers to a directory like this:
“%Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe”

Now,  just add /nosplash after the closing quotation mark of the shortcut reference.

When you now start Visual Studio from your beloved shortcut, the splash screen is gone,
saving you some time to write some excellent piece of code :-)

Still no official date for HTC Hero Android 2.1 update in Benelux

Despite the rumors, HTC doesn’t provide us with the official release date of the Android 2.1 update for the HTC Hero in Benelux.
We are waiting for months now for this update, but I think HTC is just postponing the release until the new HTC Desire will show up in Benelux, which should be there soon.

Official statement that I’ve got from the HTC customer service:

“We understand that now that a phone running Android OS 2.1 is available that you are excited to get an update for your Hero. We are still hard at work building Sense for this new version but we expect to have the upgrade finished and ready to go soon. Please understand that it takes time to customize any Android version to ensure you have the intuitive experience Sense provides, and we hope you can be patient for just a little while longer.”

This reply I’ve received when asking for a specific date (in Dutch):

Geachte Sven Schelfaut

Hartelijk dank voor Uw email. Mocht U in de toekomst nog vragen of opmerkingen hebben dan kan U bellen met 020 7157310 of ons een email sturen. Helaas hebben we tot op heden nog geen data doorgekregen voor de Benelux. Hetb beste wat u kan doen is onze website in de gaten te houden daar de update hier te vinden zal zijn.

Vriendelijke groet,

Dimphy v I
HTC

Geachte Sven Schelfaut

Hartelijk dank voor Uw email. Mocht U in de toekomst nog vragen of opmerkingen hebben dan kan U bellen met 020 7157310 of ons een email sturen. Helaas hebben we tot op heden nog geen data doorgekregen voor de Benelux. Hetb beste wat u kan doen is onze website in de gaten te houden daar de update hier te vinden zal zijn.

Vriendelijke groet,

Dimphy v I
HTC

Need a .NET Excel library?

As a developer, you definitely need to read or manipulate Excel files at some point.
There are a lot of ways to do this:

Bringing in count all the disadvantages of the methods above, I started looking for a .NET library which does the job for me.
The library needed to have the following requirements: read values and cell properties (background color,..) of both Excel 2007 and the old Excel format.
There are some paid one’s that will do the job quite well, but I have found 2 open source (and free) libraries that fitted my needs:

Now you can combine these two libraries, using a common interface, plugging in the right implementation according to the Excel format you have to process.

This is another fine example of the importance of CodePlex.
The Microsoft open source project has a big added value for developers these days!

Visual studio tip #2: Go to line

Another useful shortcut for the Visual Studio editor is CTRL + G.
This key combination enables you to quickly navigate to a specific line in your code file.
So there is no need to keep on scrolling until you reach the correct line!

Visual studio tip #1: format document

It has been a while since my last post on this blog, but now I’m back.
I will try to share some small Visual Studio tips on a regular basis, starting from now on.

A useful feature in Visual Studio is the format document option,
which you will find in the menu Edit -> Advanced -> Format document.

Off course it is quicker to use the shortcut keys (Ctrl+E,  D).
Allthough Visual Studio does a lot of formatting by its own,
there are some cases it doesn’t help you with that (i.e. in markup files)
This feature works for all the supported file formats in Visual Studio 2010.
So if you messed up your XAML or ASP.NET indentation, Ctrl+E, D is your magic shortcut!

Top 5: best Android applications

I’ve been using my HTC Hero Android phone for about 2 months now,
so it is time to make a round-up of my best Android applications so far.
Android Market contains about 18000 applications now.

Barcode Scanner

This application is just a simple barcode scanner, it scans a lot of barcode types, including QR-codes (which appear in this post).
These codes can contain a lot of info, mostly URL’s. You find them more and more in advertising campaigns.
This application can also be integrated in other applications, to pass barcode values to them.
The interface is simple and user friendly, enabling you to quickly scan your barcodes.

Shazam

This application enables you to identify the music that is played in your environment.
The iPhone version of this application was already a success, now there is an Android version of this amazing app.
On the iPhone, you have to pay for it, but the Android version is still free.
You can store the recognized songs as “tags” for later use.

Gmote

This application offers a lot of features:
Play movies and music files on your pc.
Play movies and music from your pc on your phone
Control the desktop’s mouse with your Android phone’s touchscreen.
Control keyboard input with your phone’s touch keyboard.
All you have to do is install the Gmote Server on your pc and add your favourite music or movie folders.
In the settings of the server application, you specify a password, which has to be used on the phone application.
The good thing about the application is that it uses Wifi to connect to Gmote server, so you can control your pc from a very long distance.

Swift

There are already a lot of Twitter applications in Android market, but the big killer app is not there yet, if you asked me.
For the moment, I am using Swift om my HTC Hero. The UI could be better, but the application offers the functionality I expect from a Twitter client and above all: it works very smoothly.
You can scroll endlessly through your Twitter timeline, but also the “Jump to now” feature is interesting.
Notifications of tweets, mentions and direct messages can be configured easily.
You can also look up profiles and search on Twitter. The application enables you to save your Twitter searches.
It is possible to add images and videos to your post, choosing the upload service fits best.
The application contains its own built-in browser, so you can navigate fast from links in tweets and back.

EStrongs File Explorer

A File Explorer can’t be missed on an Android phone.
ES File Explorer enables you to explore all folders on your phone’s sd card and you can open, copy and delete files.
The big difference with the most other applications is that you can also explore Windows shares with this one.
It is also possible to copy files between Windows shares and the sd card.