# Friday, October 30, 2009
Using generics to simplify getting data from a SqlDataRow or DataRow object.
Friday, October 30, 2009 4:17:54 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Thursday, October 29, 2009
Launch another program, and optionally wait for it to complete.
Thursday, October 29, 2009 4:12:31 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, October 28, 2009
A simple validation routine to validate a string meets the minimum and maximum length requirements.
Wednesday, October 28, 2009 4:09:54 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, October 14, 2009
WinForm: The base class % could not be loaded.
Wednesday, October 14, 2009 6:27:16 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, October 07, 2009
Interview screening and consulting
Wednesday, October 07, 2009 5:14:00 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 
# Tuesday, September 29, 2009
Using the MasterType directive to programatically access you Master Page.
Tuesday, September 29, 2009 5:34:35 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
Just a general rave about WebSpark, and a rant about PayPal.
Tuesday, September 29, 2009 5:23:27 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Friday, September 25, 2009
Placing page trace information in a file instead of on the page
Friday, September 25, 2009 6:11:05 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, September 23, 2009
Interview question -- the virtual keyword
Wednesday, September 23, 2009 5:45:06 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
Fancy tooltips in WinForms!
Wednesday, September 23, 2009 4:58:23 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, September 22, 2009
Adding a WinForm tooltip without the control..
Tuesday, September 22, 2009 5:38:13 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
Why so few posts recently..
Tuesday, September 22, 2009 5:15:25 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, September 16, 2009
How to enumerate all the shortcut keys in the Visual Studio IDE
Wednesday, September 16, 2009 6:22:12 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

I am getting settled in my new project, and it only took me a week to get rights to install anything on the laptop! A lot of people would say "Wow, a billable week with no work!" but personally, the days just drag by. I'd much rather be buried in code. I did make some good use of the time though, digging into what documentation I could find and creating a new Functional Specification Document. I did finally get my rights, so tomorrow will be spent installing things and looking into code again.

I did get some reading done though, and I saw that in VS2010 C# will have optional and named parameters. I know the VB crowd (of which I come from) will chuckle a little at that, as that feature has been around forever. Until now, it's required C# developers to overload functions. Nothing Earth-shattering about this feature, other than as part of it, C# will support named parameters and default values as well as part of the implementation (the default values are part of the defiinition of the function).

All Things | C# | CSharp | General | VB.Net
Wednesday, September 16, 2009 5:36:56 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Monday, September 07, 2009
Debugging trick for placing a condition on a breakpoint to assist in speeding up debugging.
Monday, September 07, 2009 11:46:14 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
How to make the Visual Studio debugger break where the error actually occurs.
Monday, September 07, 2009 11:28:20 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Saturday, September 05, 2009

As I was looking through Scott Hanselman's List of Tools for 2009, I saw a reference for Microsoft's Sketchflow (part of Microsoft Expression), which allows you to design (among other things) and work through ideas prior to coding. I am going to check it out this weekend, and maybe some of the alternate tools he recommended for his post.  I might even have to dust off my Table PC, as it seems like a good combination.

Saturday, September 05, 2009 4:55:17 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Friday, September 04, 2009
Tipf of the Day: A brief discussion of the new Extension Methods in .Net 3.5
Friday, September 04, 2009 6:10:29 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Thursday, September 03, 2009
Starting a new project, how to approach it?
Thursday, September 03, 2009 8:41:58 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, September 02, 2009

I can't take credit for this, as I took it from the article How To Get Table Row Counts Quickly And Painlessly on SqlServerCentral.com by Kendal Van Dyke. However, it such a good tip, I had to change it a bit, as I tend to use this a LOT.

First, I made the results a little more "printable" but reducing the table name column. Next, I made it a system proc because when I go onto client sites, I am looking at many databases. I probably don't need to create a procedure for it, but there have been many cases where I trend things, and it would be nice to have this handy. Finally, I added a parameter to allow me to change the sorting. By default, it sorts by table name. I added an optional parameter to allow me to pass in an integer (could have done it a million ways, I know, but I chose to do this solely for my preferences -- feel free to change to yours).

Usagesp_retrieveRowCounts    --- sorts by table name

            sp_retrieveRowCounts 1  ---sorts by row count, then table name

Here's the proc:


USE master
GO

IF (SELECT OBJECT_ID('sp_retrieveRowCounts','P')) IS NOT NULL
BEGIN
    DROP PROC sp_retrieveRowCounts
END
GO


CREATE PROC sp_retrieveRowCounts (@OrderByCount int = null)
AS
BEGIN

    DECLARE @OrderByParm int
    DECLARE @SQLStatement varchar(700)
    DECLARE @OrderByClause varchar(35)
    
    SELECT @OrderByParm = ISNULL(@OrderByCount,0)

    IF (@OrderByParm != 0)
        SELECT @OrderByClause = ' ddps.row_count DESC, o.NAME ASC'
    ELSE
        SELECT @OrderByClause = ' o.NAME ASC'

    SELECT @SQLStatement = 'SELECT TableName = LEFT(o.name,50), TotalRows = ddps.row_count FROM sys.indexes AS i
     INNER JOIN sys.objects AS o ON i.OBJECT_ID = o.OBJECT_ID
     INNER JOIN sys.dm_db_partition_stats AS ddps ON i.OBJECT_ID = ddps.OBJECT_ID
     AND i.index_id = ddps.index_id
    WHERE i.index_id < 2
     AND o.is_ms_shipped = 0
    ORDER BY '
+ @OrderByClause
    
    EXEC(@SQLStatement)

END

--Mark procedure as system object
EXEC sys.sp_MS_marksystemobject sp_retrieveRowCounts
GO


GRANT EXEC ON sp_retrieveRowCounts TO public
GO

 

Wednesday, September 02, 2009 6:34:10 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |