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 these few points:

  • Every object is a Dictionary.  In C#, think of Dictionary<string,object>.
  • Functions assigned into the object's 'dictionary' are like methods.
  • Functions are objects, and can be assigned like variables.  In C#, think of delegates.
  • Every parameter in a function is optional, allowing for uber-easy "function overloading".

We also covered incredibly cool tools for working with JavaScript:

You can open up MicrosoftAjax.debug.js file by cruising to C:\ Program Files\ Microsoft ASP.NET\ ASP.NET 2.0 AJAX Extensions\ v1.0.61025\ MicrosoftAjaxLibrary\ System.Web.Extensions\ 1.0.61025.0\ *.debug.js (spaces added for clarity)

And the coolest thing of all -- anything built in JavaScript is available for download by choosing "View Source".  When you publish anything in JavaScript, you don't publish a compiled assembly, you publish your source.  Thus anything created in JavaScript becomes awesome reference material -- bonus!

The slides for this are in Powerpoint 2007 format and available here.  The code we walked through was from Rob Bagby's webcast series on the ASP.NET AJAX Client Libraries available from his blog: blogs.msdn.com/bags/archive/2007/06/07/latest-asp-net-client-libraries-webcast-sample-code-and-links-to-all-sessions.aspx and blogs.msdn.com/bags/archive/2007/06/07/links-to-remaining-asp-net-ajax-client-libraries-webcasts.aspx

Thanks to all who came -- you got some cool swag, and thanks to our sponsor who bought the pizza and showed us just how much we love LINQ. :D

Rob

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