Firoz Ansari's Weblog

June 2005 - Posts

PowerMenu – Minimizing application to system tray

I would like to share one of my favorite utility tools with you. PowerMenu is the collection of extensions to the window menu which really save me when I am working with lot of application at a time. Following are the listing of those extensions:

 

Priority > Changes the priority of the window's parent process
Transparency > Changes the transparency level of the window (Windows 2K/XP only)
Always On Top > Makes the window sit on top of other windows even if it doesn't have focus.
Minimize To Tray > Remove the window from the task-list and places the window's on the system tray.
 

Most of the time my task bar is filled with some of the applications every time. These applications like CVS, Explorer, TextPad, Browser (IE2) and some word documents etc. Even though I need CVS once in a hour, but I prefer to keep open every time. It’s my habit!!! :) Same goes to utilities TextPad (with very small size and always on top mode) and IE2 as well. This results with lot of application taking my “precious” place in task bar. So PowerMenu utility comes handy to move some of the “required” application to system bar to make task bar more cleaner.

 

You can download it from following URL:

http://www.veridicus.com/tummy/programming/powermenu/

 

I have created a small batch file and placed it into the Startup folder so that I don’t need to run every time. Batch file contains following command:

 

PowerMenu.BAT

"E:\Utilities\PowerMenu\PowerMenu.exe" -hideself on

 

Thanks Thong Nguyen for this handy utility!!

 

 

SQL Server 2005 - Data Paging

It now becomes a UI standard for displaying records in paginated grid format. If you have list of employees then you always wanted to only show 10 (or something) at a time. And if user wants to see next set of employees he should click on the next button which will pull next set of 10 employees. So this way, every time you will have controlled limit of payload which will pass from server to browser.

 

There is a common technique used by developers to use induced a primary key in my temporary table and show paginated records from there. You must wanted to learn that approach. Visit:

 

Manual Paging, part I

http://mceahern.manilasites.com/dotnet/pagingpart1

 

Paging: Use ADO, getrows, or a Stored Procedure?

http://www.15seconds.com/issue/010308.htm

 

Is Paging with Recordsets the Best Method?

http://www.15seconds.com/issue/010607.htm

 

But now in SQL Server 2005, you don’t need to create any temp table etc. to achieve the same result set. Microsoft extent SELECT statement with new ranking function ROW_NUMBER() which return row number in result set itself.

 

SELECT ROW_NUMBER() OVER (ORDER BY OrderID) AS RowNumber, OrderID, OrderDate

FROM Orders

 

Which will give result some thing like:

RowNumber            OrderID     OrderDate

-------------------- ----------- -----------------------

1                    10248       1996-07-04 00:00:00.000

2                    10249       1996-07-05 00:00:00.000

3                    10250       1996-07-08 00:00:00.000

4                    10251       1996-07-08 00:00:00.000

5                    10252       1996-07-09 00:00:00.000

6                    10253       1996-07-10 00:00:00.000

7                    10254       1996-07-11 00:00:00.000

8                    10255       1996-07-12 00:00:00.000

9                    10256       1996-07-15 00:00:00.000

10                   10257       1996-07-16 00:00:00.000

 

 

So now you can utilize this row number of the record to qualify the required records from whole table. How? Here I go

 

WITH Ordered AS (

SELECT ROW_NUMBER() OVER (ORDER BY OrderID) AS RowNumber, OrderID, OrderDate

FROM Orders)

SELECT *

FROM Ordered

WHERE RowNumber between 21 and 30

 

And result will be something like

RowNumber            OrderID     OrderDate

-------------------- ----------- -----------------------

21                   10268       1996-07-30 00:00:00.000

22                   10269       1996-07-31 00:00:00.000

23                   10270       1996-08-01 00:00:00.000

24                   10271       1996-08-01 00:00:00.000

25                   10272       1996-08-02 00:00:00.000

26                   10273       1996-08-05 00:00:00.000

27                   10274       1996-08-06 00:00:00.000

28                   10275       1996-08-07 00:00:00.000

29                   10276       1996-08-08 00:00:00.000

30                   10277       1996-08-09 00:00:00.000

I know this will going to save lot of afford for me.

SQL Server 2005 (Beta 2) - Database Object Information HotKey

It was really handy and useful hot key to inspect the object definition in Query Analyzer (SQL Server 2000). If you have to see object definition without moving into another child window, select any object in query pane and press ALT+F1. Voila!!!

But, it seems like that this short key will be missing in SQL Server 2005. I hope that this is a bug in the beta version and will be addressed in actual release.

I am not sure where should I raise this issue (or bug), but I should have a short key (F12??) in order to inspect object definition.

SQL Server 2005 (Beta 2) Installation Error!

While installing SQL Server 2005 (Beta 2) in my machine today, every time I was ending up with an error message:
Errors occurred during the installation:
Beta components detected.
Error 50307 installing .Net Framework 2.0


Error message is bit encryptic, providing no idea what’s wrong in my machine. I have spent 2 hours to figure out the cause of this error message. After googling all related issues with installation of SQL Server 2005, I learned that it’s actually a compatibility problem with .NET CLR 1.2.

After uninstalling .NET 1.2 from my machine, SQL Server 2005 installed properly in my machine. Yeah…I know that I have to reinstall v1.2 again for my current projects.

Installation was very straight forward and descriptive (that I always expect from Microsoft) if you exclude above “incompatibility” issue.

More Posts