Tuesday, October 19, 2010

Add Using for Controls or lookup very useful

In VS 2008, when the caret is on the name of the class which doesnt have a using statement in the file, SHIFT+ALT+F10 will bring up a context menu to add the using statement.

Reboot Remotely

When you work in distributed environment you probably use remote desktop session as you primary method of sql server machines administration. When critical windows updates are installed or when you install system or sql server service pack installation wizard promts you to restart the box in order to complete the installation. And it happens from time to time that this  machine hangs on reboot process for some reason and you can no longer connect it via remote desktop. If it was you local computer you could enter into your server room and press the reset button but if it stand thousands miles away from you it becomes a real problem.
How to restart or shutdown remote machine
If you can ping this machine from other computer and you have administrators rights on that machine you may use windows utility.
On a computer that has connection to the server which needs to be restarted or shutdown go to Start -> Run and type shutdown -i

This window will show up. Press Add and type either IP or DNS of remote server.
Select shutdown or restart and press OK. That 's it. For your convenience you may run from command line constanct ping  (ping servername -t) when the server actually stopped to respond to pings and when it started again.
Alternatively you can go to command prompt (start -> run -> cmd) on your workstation and Typeshutdown -r -m \\x.x.x.x
Replace x.x.x.x with the IP address or computer name of the remote machine. -r option is for restart, don't use -r if want to just shut down the system.