Here are my initial impressions on the released version of VS2005. I attended PDC 03 and played with both Longhorn and Whidbey but as time went on I found it hard to keep up with the releases and all the nuances of the near "black magic" it seemed it took to get the CTPs, betas, and release candidates installed correctly and working. Being on a full-time project with deadlines and trying to develop a software product on the side meant I had to be careful about my focus.
Installation
Having worked with SQL since 6.5 and all versions of .NET and Visual Studio, I knew I wanted to install SQL 2005 first. My test environment was a Windows XP SP1a Virtual PC image I had saved off as a baseline (hadn't gotten around to making an SP2 one). First thing I did was install SP2 and reboot to ensure a clean foundation. I tried installing SQL and received an error 193 while trying to install .NET Framework 2.0. Since it was Thursday evening, there was little to find online for help with either Google or MSDN searching (still too soon?). I then found that the .NET Framework 2.0 Redistributable was now available so I installed that and tried SQL 2005 again. Same error. At this point, I gave up on SQL 2005 since I was initially interested in VS 2005. The VS2005 install went smoothly including SQL Express.
First Surprises
I confess that I hadn't had time to pay much attention to SQL 2005 so when I went looking around for an Enterprise Manager type of application I was surprised to find nothing. Also, I had stepped back from the beta stuff before the express editions came out so I hadn't tried or followed anything with them. A little hunting around lead me to the VS Express Editions page where I learned there's something called "XM" for Express Manager (a 'lite' version of Enterprise Manager) but it wasn't ready yet. Since I had an existing VS 2003 application with a database I first needed to figure out how to get it brought over.
Setting Up A Database
I found out you can use a new command window utility called 'sqlcmd' which gives you a command line interface. Having worked with Oracle's Server Manager for years as well as DB2, I wasn't too worried. Interesting side note, Oracle finally removed SvrMgr in version 8 forcing people to use the newer Java-based graphical UI which some complained about. Now we find Microsoft which has always had Enterprise Manager since 6.5 (earlier?) is now introducing a command environment. Since we use a database project, I tried to update the connection but couldn't get it to work. I finally resorted to using sqlcmd to create an empty database. With a little poking around I found the default instance is referenced via '.\SQLExpress' so you launch it with 'sqlcmd -S .\SQLExpress'. Note that the -S is case sensitive so if you use a lowercase -s it'll hang for a long while before it finally returns an error. Upon successful connection, you'll receive a cryptic '1>' prompt so if this is your first time, don't be alarmed. Just start issuing T-SQL commands. Here's one I used to create an empty database:
USE [master]
GO
CREATE DATABASE [ComposerDb] ON
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ComposerDb.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ComposerDb.ldf' )
FOR ATTACH;
GO
After that, I deleted the connection in the database project, created a new one using the "new" server name in place of (local) and was able to run our scripts to create the tables, views, and stored procedures without a hitch. Skipping ahead, when I tried to run the web service project, I received a security error - unable to connect. Not a problem, I forgot to grant the ASPNET account (for XP w/ IIS 5.1) permission. Back to the sqlcmd window for a CREATE LOGIN using the example in the online help. However, at this point I became stuck. I couldn't seem to get a CREATE USER to work so I couldn't get the ASPNET user into the new database. After a lot of hunting on MSDN newsgroups, and Google searches, I finally gave up and tried installing just the client tools for SQL 2005. It went without a hitch although it took a long time to run. When it was finished, I could launch the new Enterprise Manager (it recognized the SQLExpress instance) and was able to add the ASPNET user to the database. Finally the web service test page came up and I was off and running.
Project Conversions
In between the above SQL bumps, I opened my existing VS2003 solution and the conversion wizards worked great. When all was done I had the following projects converted: a data access layer, a business model layer, two business model factories (direct connection and web service interface), a web service layer, and an admin UI. We were using NUnit for our tests and I needed to install it. I had 2.2.0.0 dated 8/8/2004 and when I ran the MSI it complained that it needed .NET Framework version 2.0.40607. Since it didn't like the RTM version, I opted to simply copy my existing implementation from my VS 2003 machine and followed the instructions for manual registering.
Conclusion
The VS2005 installation and conversions of the existing projects went extremely smoothly and I'm very pleased with the quality and the experience. The SQL 2005 (Express and Standard) I think is due to just being early. If I had invested time with the betas and CTPs it no doubt would've been a no-brainer. I'm sure that as weeks go by, more and more information will be published and answers to any questions will be easy to come by. Having a graphical admin tool such as Express Manager will go a long way to curing any hiccups.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.