February 2008 Entries

LINQ to SQL Visualizer isn't in the transaction it is visualizing

The LINQ to SQL Visualizer is a phenomenal tool.  This is how debugging should be done.  Scott Guthrie introduced it in the Visual Studio 2008 Beta 2 timeframe, and I've been hooked ever since.  It's now bundled in the Visual Studio 2008 RTM samples, though it's not installed by default.  Instructions of how to install it are here. Well, I'm splunking along in some code that happens to be in a transaction.  I've just inserted a row, and I'm about to execute the select that refreshes the business object with generated content including the primary key.  I open up...

Compile time reminders

For ages I've wanted to be able to put a comment of some kind in my code that I could get to come up during a build.  "Hey, you haven't finished this" or "This is an assumption we need to run by the suits" or "you dork, how could you even think to do it this way" or similar -- notes to myself and others that there is work left to be done here. Well, after trying unsuccessfully to look towards subclassing or hacking the Obsolete attribute the answer was handed to me: 1. I build comments in...

Filter Sql Server Profiler by Database

Ok, I stumbled with this one enough times to log it here.  I want to tune a database I'm working with.  I dutifully fire up Sql Server's Profiler, and no where in the options do I see "filter by database". Ok, the option is there, but it takes some doing to get there.  When you're building the profile, in the events selection tab, choose "show all columns", then you'll find the "Database Name" column.  Pop in the database name in question, and you're golden. source: http://sqljunkies.com/Forums/ShowPost.aspx?PostID=14078

Thinking in JavaScript for the C# Developer

I had the great privilege and honor of presenting "Thinking in JavaScript" at the SouthEast Valley .NET Users Group this evening.  All in all, I had a ton of fun.  If anyone else got anything out of it, all the better. The main point of my discourse was that JavaScript isn't hard by any means, it just takes an introduction to how it thinks.  Microsoft's ASP.NET AJAX has made it feel much more like the .net languages we're used to.  But there are still some inherent differences between a compiled language and a dynamic language. The main focus of the discussion is...

DropDownList's SelectedValue in JavaScript

Ok, I've forgotten this more times than I care to remember, and each time, I have to re-Google it.  I hereby commit it to digital memory: If you have a DropDownList control like so:      <asp:DropDownList ID="mycontrol" runat="server"></asp:DropDownList> and you want to get it's selected value in JavaScript, do it like so:      var control = $get('<%= this.mycontrol.ClientID %>');      var selectedvalue = control.options[control.selectedIndex].value; And there ya have it.  I hereby have forgotten it already... :D Rob

Double-click the document in Solution Explorer -> Code View by default

Ok, this has been an annoyance for long enough.  I'm in Visual Studio.  I double-click on a web service's code behind file in the Solution Explorer, and up pops an empty designer window.  I close the irrelevant window (once it finishes loading), right-click on the file, and choose "View Code", then promptly kick myself for doing it again. The solution comes from http://www.thescripts.com/forum/thread106933.html: If you want to go to code mode by default, do the following: 1) Right click on the document name in the Solution Explorer 2) Choose "Open With" 3) Select "Csharp editor" 4) Choose "set as default" I did this, and I'm golden --...