MSDN Magazine article

This months MSDN article (April 2008) is very interesting.  The article is on page 99, titled “Test Run Testing SQL Stored Procedures Using LINQ,” by Dr. James Mccaffrey.  It peaked my interest because I’ve been looking for a sample test harness for LINQ and stored procedures.

I downloaded the sample code at msdn2.microsoft.com/magazine/cc13511.  Installed it on my Visual Studio 2008 Pro and tried to run it out of the box.  Well, it did not run.  It could not connect to the database.  So, I looked for the sql script somewhere in the installed files and found it.  I was also missing the SQL Server Management Studio Express, so I had to install it to run the sql script.  After running the sql script the test run code still does not run because it could not connect to the database.  So, I manually connect the database through Visual Studio.  It still would not connect.  I discovered that my manual connection string is not the same as the code so I went ahead and replace it:

string connString = “server=.\\SQLEXPRESS;Initial Catalog=dbMovies;Integrated Security=True”;

Well, the code runs as expected after replacing the connection string.  So, I just want to put this blog post out there for other folks that are going to blaze the same path to save them some time.  I also sent a note to the author.

Regards,

Bennett

2 Comments »

  1. bfonacier said

    As I read through the rest of the article, I realized the test harness is not using any of the test framework, like NUNIT. Each test is just reporting pass/fail on the command line.

    I was looking for a test harness that can take advantage of the test frameworks that are out there. Also, the new Visual Studio 2008 has a “Test” menu with a wealth of features. I wanted to also see an article that can take advantage of these features in VS2008.

  2. Bennett said

    Hi Bennett,

    Thanks for the heads-up, and thanks for posting the details on your blog site.

    Yes, you are quite correct. When I created the SQL database for the MSDN Magazine article, I used the full-fledged SQL Server 2005 product. If you use the SQL Server Express product, which is specifically designed for experimentation then you can change the connection string as you noted.

    Connection strings in general are a tricky topic. I often find myself going to the nice http://www.connectionstrings.com/ Web site.

    James M

RSS feed for comments on this post · TrackBack URI

Leave a Comment