February 2010 Entries

Comparing ways to get rowcount from a database table.

Just read this and found it very interesting. The following are 2 queries to get rowcount on a database table: Query 1 (the one everyone knows): SELECT COUNT(RowID) AS [RowCount] FROM elig_Inbox Query 2 (the interesting one): SELECT st.row_count AS [RowCount] FROM sys.dm_db_partition_stats st WHERE index_id < 2 and OBJECT_NAME(OBJECT_ID)='eli... What's really interesting to me is that once you look at the execution plan of the 2 queries, you'd find the improvement in performance. In real ......

Posted On Thursday, February 25, 2010 10:07 AM | Comments (1)

JavaScript CheckAll checkbox changes not being picked up by GridView code behind

If you need to use JavaScript to do a Check All on all the checkboxes in the column, be sure to use this guy's code: http://www.highoncoding.com... If your code simply change the state (...checked == true), it does not get registered and does not get passed into the code behind. Instead, follow AzamSharp's article and make sure you initiate a click() event ......

Posted On Wednesday, February 24, 2010 4:03 PM | Comments (0)

What is the advantage of WCF

I knew the basic idea of WCF and how to build one, but could never win an argument on why it is better than a web service.

Thanks for Christopher Roberts of Oakwood Systems Group Inc. sending me this link.  I can answer that question much better now.

http://msdn.microsoft.com/en-us/library/dd943056.aspx

Posted On Friday, February 19, 2010 2:07 PM | Comments (0)

Convert GridViewRows into a DataTable to edit data in ASP .NET

I recently ran into a business problem that I can't find any sample code online. I think I worked out a tolerable solution. The business scenario is this: All rows retrieve from the database must be in edit mode, but only some fields should be in edit mode, not all. Editing one row at a time is out of the question. User might make changes and THEN want to sort the grid. Any user input needs to be preserved. Have to use .NET control that come out of the box with Visual Studio due to maintenance concerns. ......

Posted On Friday, February 19, 2010 1:31 PM | Comments (2)

Do not put slash in your post title

I just discovered that if I put a "/" in the post title, I can't get to it via URL.  It makes sense, but I thought it would be handled in the post process.  Apparently not.

Heads up!

Posted On Thursday, February 18, 2010 5:29 PM | Comments (0)

Virtual PC BIOS password protection is a MOO point

Sometimes what Joey said made sense.  Need some recollection of comedy to cheer me up because I'm pretty bummed out right now.

For a while, I've been "protecting" my virtual PC by putting a password on the Virtual PC's BIOS.

Just so happens that I moved the vhd to another location without moving the vmc file with it.  Created another vmc, and the VPC started without asking me password.

Lamenting on all the time I've wasted!

Posted On Thursday, February 18, 2010 3:03 PM | Comments (0)

Bring back icons in system tray notification area, like the Safely Remove Hardware and the Display Link Manager icon

I had this problem before on "Safely Remove Hardware" icon disappearing.  I was able to use this method to access the dialogue box:

Start -> Run -> RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll

Right now trying to solve the problem where my USB display adapter is not working and not showing icon.  But I think this might be a problem with the USB ports configuration instead of icon not showing up in System Tray.

Posted On Thursday, February 18, 2010 10:27 AM | Comments (0)

Use expression to build the file connection string instead of using script task to build a variable

I've always used the Expression property to dynamically build the connection strings. It has always worked without any problem, so I never gave it much thoughts. However, a package we converted from DTS was built using script task to build the connection string before writing to the file in a data flow task. The reason it was converted into a script task was because the DTS package was using an ActiveX script to generate the file path, and it was a quick and dirty 5-minutes-job to convert that into ......

Posted On Wednesday, February 3, 2010 10:34 AM | Comments (0)

Partition Wizard probably saved me at least 20 hours worth of work!

I had my work laptop set up as dual boot to 80G for Windows 7 and 40G for Windows XP. As time went by, I had to install all the applications in Windows XP as well, and it was quickly eating away the space. With Windows 7, I was able to use Disk Management and do a "Shrink Volume" to get 15G of space unallocated. But when I tried to extend Windows XP partition, I found out I didn't have that option. I followed this post (http://www.sevenforums.com... and tried ......

Posted On Tuesday, February 2, 2010 4:59 PM | Comments (0)

Stop a SQL job in the first 5 days of the month, but report success

It is actually quite simple when I think this through: Make the first job step with this T-SQL query: IF ((SELECT DAY(GETDATE())) < 6) BEGIN SELECT 1/0 END Go to the Advanced Tab of the Job Step property page. Select "Quit the job reporting sucess" on the "On Failure Action" drop down. Note: You can use RAISERROR, but the Severity has to be set to greater than 10. To avoid future maintenance confusion, I decided to go with the basic fatal error generation ......

Posted On Tuesday, February 2, 2010 1:12 PM | Comments (0)

Copyright © Kevin Shyr

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski