A personal repository of technical notes. - CSC

Debug Classic ASP in Visual Studio

Note: This was tested in VS2010 and IIS 7.5.

In IIS:
  • Set up Classic ASP website in IIS.
  • Set Classic ASP application to allow ASP debugging:
    • Click on application
    • Double-click IIS/ASP
    • Open Debugging Properties
    • Enable Server-side Debugging = True
    • Click Apply
In Visual Studio:
  • Add breakpoints in server-side code of Classic ASP.
  • Start debugging:
    • Debug Menu/Attach to Process/Available Processes
    • Select w3wp.exe
    • Click Attach

HashSet to Comma Delimited String

HashSet Coding Example: A HashSet is a collection that contains no duplicate elements.

Note: Tested in .NET 4.0.

       HashSet<string> myHashSet = new HashSet<string>();
       myHashSet.Add("A");
       myHashSet.Add("B");
       myHashSet.Add("B");
       myHashSet.Add("B");
       myHashSet.Add("B");
       myHashSet.Add("X");
       myHashSet.Add("Z");
       myHashSet.Add("B");
       myHashSet.Add("A");
       string commaDelimitedString = String.Join<string>(",", myHashSet);
       // commaDelimitedString is equal to "A,B,X,Z"

References
"HashSet(T) Class (System.Collections.Generic)." MSDN – the Microsoft Developer Network. N.p., n.d. Web. 16 Oct. 2013. <http://msdn.microsoft.com/en-us/library/bb359438(v=vs.100).aspx>.

SQL Server Management Studio Settings

Miscellaneous, useful settings in SSMS.

Note: This was tested in SSMS 2012.

Assign custom colors to database servers. These colors are used on the status bar.
  1. Connect to Server
  2. Options >>
  3. Connection Properties tab
  4. Use custom color:

Change what is displayed in Tab Text (Example: Remove text that is redundant with status bar.)
  1. Tools/Options/Text Editor/Editor Tab and Status Bar/Tab Text
  2. Include database name (False)
  3. Include file name (True)
  4. Include login name (False)
  5. Include server name (False)

Copy column headers with query results
  1. Tools/Options/Query Results/SQL Server/Results to Grid
  2. Check "Include column headers when copying or saving the results"