Must Have Productivity Software?

by Nick Thursday, June 12, 2008 11:20 AM

Last night I headed down to Chicago for the monthly Alt.NET meeting, which was at the ThoughtWorks office.  Just briefly, that looks like a great place to work... they have a gorgeous office.

The meeting was mostly a smack down between ReSharper and CodeRush.  I seemed to stand out early on because they first asked which people in the audience used which one.  I think I was the only one in the audience that used neither... I am a Visual Studio purest.  For one, I was never willing to fork out > $100 for a productivity package like that.  For another... I like writing that much code by hand because I genuinely believe that it makes me think about my code and my architecture more.

Afterwards, I won a license to my choice of ReSharper, CodeRush or SqlPrompt.  Based on the smack down (which was done Horse style thanks to my suggestion), I had to say that CodeRush looked much cooler, and from a usability standpoint, seemed to be the better choice.  Hopefully I'll have my license in hand soon so I can test it out, and report on whether I think its worth the money, or whether it helps or hinders my code writing.

Out of the tools they gave away, the one they only showed briefly was SqlPrompt.  From the brief demo, all I can say is wow.  Intellisense in SQL Management Studio, or even Notepad?  Are you kidding me?  I'd love to get my hands on a copy of that... but once again... not sure I can justify the cost to myself.

LINQ and Stored Procedures Not Always Magic

by Nick Monday, June 09, 2008 3:45 PM

I had an interesting experience while trying to import a stored procedure into a LINQ to SQL Classes Designer surface today.  Normally this is a pretty straightforward process.  First you open Server Explorer, then go to one of your connections, find the stored procedure, and then drag and drop it onto the designer surface.  Boom, it's suddenly available from your DataContext as a method. 

That's exactly what I did today, except when I created a var for the stored procedure result set, and then added a foreach to loop through the rows in the result set... nothing showed in my Intellisense.  Huh?  A little hover magic and I saw that my generated method was returning an int.

After some investigation, I found that the designer has a hard time handling stored procedures that use temporary tables in them, as it throws off the procedure meta data.  As it turns out, there are two possible solutions.  First, you can use a table variable instead:

DECLARE @tempTable TABLE ( ... )

Your second option is to continue to use a temporary table, but hand modify your dbml file using an XML editor.  Simply right click on the file in Solution Explorer and choose Open With and then choose your favorite XML editor.  Mine is Notepad2.  Search through the file for your stored procedure, which for a procedure named "storedProcedureName" might look like this:

<Function Name="dbo.storedProcedureName" Method="storedProcedureName">
  <Parameter Name="Parameter1" Parameter="Parameter1" Type="System.Int32" DbType="Int" />
  <Return Type="System.Int32" />

Then remove the <Return ... /> element and replace it with an <ElementType> node which may look like this:

<Function Name="dbo.storedProcedureName" Method="storedProcedureName">
  <Parameter Name="Parameter1" Parameter="Parameter1" Type="System.Int32" DbType="Int" />
  <ElementType Name="storedProcedureNameResult">
    <Column Name="Result1" Type="System.Int32" DbType="int NOT NULL" CanBeNull="false" />
    <Column Name="Result2" Type="System.String" DbType="varchar(10) NOT NULL" CanBeNull="false" />
    <!-- ... -->
This second method is the one that I used since my temporary table will hold thousands of rows, which is too inefficient for a table variable.

How to Get a Geeky Guy

by Nick Monday, June 09, 2008 8:31 AM

For all those ladies interested in catching a geeky guy... or keeping one once you've snagged him, here is a funny guide for you.  Via @larryclarkin.

Looking For Some Cool Free Software?

by Nick Friday, June 06, 2008 11:27 AM

The Quoteable Coworker

by Nick Wednesday, June 04, 2008 1:10 PM

The names, as always, have been withheld to protect the innocent...

Coworker 1:  I haven't exactly seen numbers showing .NET running circles around VB6 performance wise.
Coworker 2:  You haven't?  I'll go find some right now.
Coworker 1:  But not from Microsoft.
Coworker 2:  Why?  They created both, so they should be unbiased.

When Good XML Goes Bad

by Nick Monday, June 02, 2008 11:42 AM

Coding Horror recently went after XML as being a rather poor option for many things.  I generally don't agree with that sentiment, but I do agree with the idea that there is good XML structure and bad.  Here is an example of bad XML structure that is required to use a control library from Janus.  This sample XML snippet is required to define the columns in their grid control:

<Columns Collection="true">
  <Column0 ID="">
    <Caption>Home Term</Caption>
  <Column1 ID="Column1">
  <!-- ... -->
The controls so far look rather nice, and fairly functional and complete.  At issue here is the use of tag names like "Column0" and "Column1".  A well designed XML structure would just have "Column" tags, and then use some sort of extra identifier... which ironically... they already do!  Yet they require that the tag name matches the identifier.  Definitely not a good use of XML's inherent structure and definition abilities.

About Me

Nick Schweitzer Nick Schweitzer
Wauwatosa, WI

Contact Me
I'm a Software Consultant in the Milwaukee area. Among various geeky pursuits, I'm also an amateur triathlete, and enjoy rock climbing. I also like to think I'm a political pundit. ... Full Bio

Community Involvement



Flickr Photos
This is a Flickr badge showing public photos and videos from Nick_Schweitzer. Make your own badge here.

Standard Disclaimers

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017 Nick Schweitzer