Missing Web Site Templates in Visual Web Developer 2008 Express Edition

Continuing in my quest to experience the goodness of the new .NET 3.5 SP1 stuff from the ground up, I installed Visual Web Developer 2008 Express Edition.  After all, now that I have my AdventureWorks database up and running, I want to experiment with ASP.NET data scaffolding (ASP.NET Dynamic Data), JavaScript Intellisense, ADO.NET Entity Framework, ADO.NET Data Services, and many of the other great new features in this release.  As Scott Hanselman and Carl Franklin recently discussed on Hanselminutes, this framework update really should have been .NET 3.6 there is so much new stuff in there!

 

The Problem

So I was sorely disappointed to start my first web site and was prompted with this confusing dialog box after doing a File -> New -> Web Site:

image

Selecting a different version of the framework didn’t fix anything, I had no web site templates!  How was I going to follow all of these simple step-by-step tutorials if I couldn’t get past step 1?  From the scores of other people having the same issue, I could tell I was not alone in my frustration.

Allow me to back up a bit and describe how I got into this predicament — it didn’t take long…

image

 

After installing, I did the natural thing and clicked on the item in my start menu labeled “Microsoft Visual Studio 2008” as it seemed to be the only logical choice.  Verifying the properties shows that this shortcut is pointing to C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Devenv.exe, which is exactly what I would have expected from experience with other versions of Visual Studio (insert snide remark about seemingly old version number in the “Common7” part of the path).

 

The Solution

No telling if this will be the same problem that everyone else seemed to be having, but it appears I just opened the wrong .exe!?!  I can’t really blame myself though, since the installation process seems to be a bit misleading.  There is no shortcut anywhere to the correct application which is actually called VWDExpress.exe:

image

Launching this executable manually gives me the much anticipated web site templates, and what I need to move on .  One subtle note is that my menu path to get to this is actually File -> New Web Site.  This path is one level shallower than the full blown studio version, but they both share the same keyboard shortcut of Shift + Alt + Nimage

So, if you read the whole post above and you’re still not quite sure what I am getting at, just look at the log in your development environment:

No web site templates (bad):

image

Web site templates (good):

image

The Details

To clarify whether or not this should apply to you, I am running all free versions of the tools provided my Microsoft.  If you have a full-blown version of Visual Studio, you may not experience this problem when using the standard IDE.  I first installed SQL Server 2008 Express, then Visual Web Developer 2008 Express.

This means that I now have the following versions of these files:

devenv.exe 9.0.30729.1
VWDExpress.exe 9.0.30729.1

 

Stay tuned for more blog posts as I continue on this journey…

https://codeslammer.wordpress.com/rss

Advertisements

SQL Server 2008 Sample Databases

If you remember good ol’ NorthWind, you’ll know that having a sample SQL Server database can be great for sampling new technologies and performing RDBMS experiments and tests.  As much as detail-oriented presenters and trainers like to use NorthWind, it is an old sample from SQL Server 2000 that doesn’t have many of the new features in SQL Server 2008.

I set out to get the sample databases, and I was amazed at the complexity of it.  Not that it is in general a difficult task, but it could probably be made much more simple by Microsoft.  Since I figured out which hoops you need to jump through,  I thought I would summarize it for you here:

1) Read Up

If you want to have a successful installation of the sample databases, take 20-30 minutes to become familiar with the SQL Server Database Product Samples.  Contrary to some of the complaints people have posted in the comments, there is lots of good documentation that helps you understand the contents and process.image

Two important points you might miss are that you need to have full-text search installed and FILESTREAM enabled to ensure a problem free install of the samples.  This can be done after the fact if you did not specify these settings during the initial installation.

It should also be noted that attempting to change the FILESTREAM setting through the SQL Server Configuration Manager did not seem to work even after a restart of the engine.  Instead I had to run this SQL

exec sp_configure ‘filestream_access_level’, ‘2’
RECONFIGURE

 

2) Download & Run the Installer

Once you’ve familiarized yourself with the process and read the pre-requisites, download the .msi installer file:

http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=16040

For my Vista machine running SQL Server 2008, I picked this file: SQL2008.AdventureWorks_OLTP_DB_v2008.x86.msi

 

imageOne interesting point is that there appears to be an option to have the installer restore the database for you.  Unfortunately, when I attempted to use this option to restore it in my local SQLExpress instance, it bombed out on me requiring me to run the installer again without the option selected.  The option is not selected by default which leads me to believe that Microsoft is aware this is a potential problem area.

3) Restore the DB Manually

This is the part where people with little or no DBA knowledge probably begin to curse.  If you are running the same platform as me and accept all of the defaults, you would think this should be as simple as running this script in a new query window (based on step 6 in the instructions):

RESTORE DATABASE AdventureWorks2008
FROM DISK ‘C:\Program Files\Microsoft SQL Server\100\Tools\Samples\AdventureWorks2008.bak’

Unfortunately, this gave me a bunch of errors based on the way the RESTORE was attempting to use the default settings.

image

You can get around this by using the restore script (RestoreAdventureWorks2008.sql) in the same folder as the .bak file.  If you look at how the path is being used, you’ll notice that you have to substitute the path as follows in the top section of the script:

SET @source_path = ‘C:\Program Files\Microsoft SQL Server\100\’ 

 

Summary

So after a bit of plugging away, I was able to the the sample successfully restored.  Yea!

image

I truly empathize with Microsoft as streamlining this installation can be a daunting task.  There are an endless number of settings that have to be accounted for, security, versions, etc.  However, this installation process is much too difficult for the average developer in my view.

Now that I have some data to play around with, I expect to post some experiences about using the new 2008 features such as intellisense and the other goodies I expect to find in the newest version of this tool.  All things considered, SQL Server is still my database platform of preference and I appreciate everything Microsoft does to make this free version available to the public.

What’s that picture?

In case you were wondering what the picture is in the current banner on this blog, that’s me on a hike in a semi-remote region of Western India (Maharashtra).  Outside of Mumbai, there is a hilltop community named Matheran that has many hiking trails with stunning views of the surrounding area.  Where I am standing it is a several hundred foot drop straight down to a rocky slope below (notice the lack of guard-rails)…

Non-Numeric Characters in SQL – Follow up

Although my previous post was a bit hasty, I wanted to follow up with some additional comments about the magic in the middle of the UDF created to remove any non-numeric characters from a column in a query result set.  As you can see there is a relatively cryptic body of the function that somewhat resembles a regular expression.  While the solution fit my needs, I have been thinking more about it and realize that the ramifications ripple much more broadly than just being able to strip non-numeric characters out of a string.  My thoughts led me to the following 3 important points to consider:

Important Point #1: LIKE is often underutilized

I have been foolishly using only simple % operations in 99% (blatant overuse of per cent character 🙂 ) of my queries using LIKE.  Most of the time this is plenty of horsepower, but for when you need to dig in a little bit more accurately, it helps to know that additional wildcard characters are supported by the LIKE operator.  In short summation, try a few queries using these additional search options:

  • _ (underscore)
  • [] (range)
  • [^] (not in range)

Important Point #2: PATINDEX() is rad

The real meat of this function is the PATINDEX statement which has the advantage of being able to use wildcards.  This is pointed out with just the right amount of detail in an article by Robert Davis: Pratical Uses of PatIndex.

Important Point #3: Reader beware

One underlying important point is that none of the approaches described here may perform particularly well when working with large volumes of data.  In general, string manipulation should be performed outside of the database.  If dealing with many rows of data, this approach could be pathetically slow.  However, if you are dealing with 1000 records or less you would have to do something pretty extreme to make a query perform unacceptably slow.

Hopefully you will find this useful the next time you are slamming together some ad-hoc SQL to dig through your data.  As mentioned above, this is not recommended for most production applications but can certainly be a handy tool to have in your SQL tool belt.

SQL Server String Manipulation – Removing Non-Numeric Characters

I recently had a need to get a distinct list of numbers from a freeform text field in a database.  After some analysis, my needs were met by the following approach:

CREATE FUNCTION dbo.UFNG_ONLY_DIGITS (@StrVal AS VARCHAR(max))
RETURNS VARCHAR(max)
AS
BEGIN
      WHILE PATINDEX(‘%[^0-9]%’, @StrVal) > 0
            SET @StrVal = REPLACE(@StrVal,
                SUBSTRING(@StrVal,PATINDEX(‘%[^0-9]%’, @StrVal),1),”)
      RETURN @StrVal
END

The function can then be used as follows:

SELECT dbo.UFNG_ONLY_DIGITS(‘8asdf7%87^A8876-*S’)

to return

87878876

Thanks to all who helped in my research with these posts:

http://groups.google.com/group/microsoft.public.sqlserver.programming/msg/032f65303d22e343

http://bytes.com/forum/thread81464.html

Minor Detail, Major Impact in SSMS Script Wizard

After a few hours of pulling out what few stubs of hair I have remaining, I finally tracked down a rather perplexing problem relating to the Script Wizard feature of SQL Server Management Studio (SSMS).

My goal was to script out all of the stored procedures in a database in a fully re-runnable state, one SP per .sql file.  This would allow the procedures to be easily checked into source control, and tracked for changes that could be tied to our bug tracking system.  Having stored procedures and other database code in source control can be a tricky proposition because you need the right processes in place to ensure that any changes made to the source code are reflected in the database and migration path.  Conversely, it is equally important to ensure that any changes made directly in the database are accurately and promptly updated in source control.  Sound like a problem any of you have run into?  I know Ben Scheirman has, he posted a great summary of some database migration tools on his blog.

Although there are many good tools out there, my company is taking the “roll your own” approach because we have some specific requirements that no existing tool seems to encompass.  It has to handle SQL Server and Oracle, SPs, triggers, views, as well as ad-hoc DDL and DML changes.  It has been no picnic putting the processes and systems together, but I do think we have a good system in place.

One of the points of our approach is aided in the use of scripting tools, SSMS in particular for the SQL Server based database objects.  If you haven’t uncovered this handy tool (not very discoverable), try right-clicking on your database and following through Tasks to Generate Scripts:

image

I was scripting out a bunch of objects and trying to get home, so I thought I would try a little parallel processing to make the scripting go faster.  When choosing the settings in the SSMS “Generate Scripts” Wizard, I encountered the following differences between machine #1 and machine #2:

machine #1: Good

image

machine #2: Bad

image

Obviously, this smells like a software version difference, so I dug deep into the bowels of SQL Server’s Program Files folder (C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE) to find out that:

Machine #1: SqlWb.exe 2005.90.3054.0

Machine #2: SqlWb.exe 2005.90.2050.0

Unfortunately, Windows Update doesn’t pick up on this difference on 64bit machines!  So, unless you manually update your SQL tools, you’ll be stuck with inferior script generation options.  This is key because the options in the older of these 2 versions is not sufficient IMO.  Running Windows update on a 32bit machine yielded different results, and I was easily able to tell that I needed SQL Server SP2.  Obviously these are very specific situations, but I thought it was worth sharing

Bottom line is that you should have the following very helpful option in the Script Wizard in SSMS:

  • Script Drop

If you don’t check to make sure you’ve got a recent version of the tools.  The previous version only allows you to “Generate CREATE statements only” or “Generate DROP statements only” which is not nearly as useful as tacking the 2 together.  A useful page for quickly searching through SQL Server release details can be found here: http://sqlserverbuilds.blogspot.com/

TeamCity 1 – CCNet 0

OK, so in my preliminary experiences I have to say that TeamCity is friggin awesome. It was amazing how simple it is to setup, and the features that come pre-installed are great. Effortless email notifications, build statistics including average Winner!build time and success rates, ability to monitor multiple projects in VSS — It’s all in there. What was unexpected is the ability to keep tabs on your development effort with intuitive source control history information. There is even a built-in web component that shows you a color-coded code-diff on the spot. Code reviews have never been easier!

I am going to recommend that my company take TeamCity to an official state of adoption as it clearly fills a need and is a very well put together tool. You can configure it to have multiple build servers in the event that you are building a lot of products, so this should scale well.

Thanks JetBrains!