A personal repository of technical notes. - CSC

SSMS Connect to Server Server Name List

Problem
How do you remove the server name entries from the Connect to Server dialog box in Microsoft SQL Server Management Studio?

Solution for SSMS 2005
Delete the entire MRU list while SSMS is not running. When it starts up again, a new empty list will be created. As of this posting, I know of no way to remove individual items. MRU location:
%APPDATA%\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat

Solution for SSMS 2008
Delete the entire settings file while SSMS is not running. WARNING: This file contains other settings.
%APPDATA%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin

References
About The Connect to Server Dialog - MSDN Forums
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=146430&SiteID=1

SQL Server Forums - SSMS drop down
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=72477

How to get rid of unused servers in SSMS? - TechNet Forums
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=532146&SiteID=17

SSMS Default Database

To set default database for Microsoft SQL Server Management Studio:

1) On "Connect to Server" dialog box, click button "Options >>"
2) Under "Connection Properties" tab, select the name of the database for the connection.

.NET 2.0 Type.GetType (String) Returns NULL

Problem
Type.GetType (String, true) throws the following error:
Could not load type 'MyType' from assembly 'MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Solution
String needs to be the assembly-qualified name of the Type:
MyType.GetType().AssemblyQualifiedName


References
Haibo Luo's weblog : Type.GetType(string typeName) returns null !?
http://blogs.msdn.com/haibo_luo/archive/2005/08/21/454213.aspx

Type.GetType Method (String) (System)
http://msdn.microsoft.com/en-us/library/w3f99sx1(VS.80).aspx

CSS Indentation

<div style="padding-left:30px;">This is indented.</div>
<span style="padding-left:30px;">This is indented.</span>
<div class="Indent"></div>
<span class="Indent"></span>
<span style="margin-left:3em; text-indent:-3em;">A hanging indent.</span>
<span class="hang"></span>
<b>Updates</b>
<div class="hang">YYYY-MM-DD Added "Xxx"</div>

<div class="EdNote">Note</div>

JavaScript Enum Emulator

var pageState = {
Normal : 0 ,Autoloading : 1 ,AutoloadStopping : 2
} var myPageStage = pageState.Normal; alert(myPageStage);
References
How to do enumerations (enum) in javascript | Javascript Kata
http://www.javascriptkata.com/2007/03/22/how-to-do-enumerations-enum-in-javascript/

How to use anonymous objects | Javascript Kata
http://www.javascriptkata.com/2007/03/22/how-to-use-anonymous-objects/

Custom Command Prompt Prompt

How to make a custom 2 line command prompt for all command prompts in Windows

Example

C:\WINDOWS\system32
> _


Steps

  1. Right-click My Computer
  2. Properties
  3. Advanced system settings
  4. Environment Variables button
  5. New button under User variables for My User Name
  6. Variable name: PROMPT
  7. Variable value: $P$_$G$S
  8. OK
Notes
Where $P$_$G$S is
$p = Current drive and path
$_ = ENTER-LINEFEED
$g = > (greater-than sign)
$s = space
Note: Tested in Windows 7, Windows Server 2008, Windows XP.

References
Prompt
http://technet.microsoft.com/en-us/library/bb490977.aspx

Determine .NET Version

Updated 2011-10-17
1) In the Registry Editor, locate the Registry Key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\
2) Compare settings to table on Microsoft site:
Old Method
1) View properties version tab of mscorlib.dll in .NET framework folder.
Example:
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll
File version: 1.1.4322.2032

2) Match up to Microsoft's list:

The released versions of the .NET Framework have the following version information.

Collapse this tableExpand this table
.NET Framework versionRevisionVersion
3.5Original release3.5.21022.8
3.5Service Pack 13.5.30729.1
3.0Original release3.0.4506.30
3.0Service Pack 13.0.4506.648
3.0Service Pack 23.0.4506.2152
2.0Original release2.0.50727.42
2.0Service Pack 12.0.50727.1433
2.0Service Pack 22.0.50727.3053
1.1Original release1.1.4322.573
1.1Service Pack 11.1.4322.2032
1.1Service Pack 1 (Windows Server 2003 32-bit version*)1.1.4322.2300
1.0Original release1.0.3705.0
1.0Service Pack 11.0.3705.209
1.0Service Pack 21.0.3705.288
1.0Service Pack 31.0.3705.6018
*The Microsoft .NET Framework 1.1 is included with the 32-bit version of Windows Server 2003.
(Microsoft Help and Support)

See Microsoft's web site below in References for latest list.

References
"How to determine which versions of the .NET Framework are installed and whether service packs have been applied." Microsoft Help and Support. 30 Jan. 2009 http://support.microsoft.com/kb/318785.

DLL Help Database
http://support.microsoft.com/dllhelp/?dlltype=file&l=55α=Mscorlib.dll&S=1&x=10&y=13