A personal repository of technical notes. - CSC

Enable NTLM Authentication in Firefox

Problem
Need to be able to perform NTLM Authentication for Single Sign-On Integrated Authentication using Firefox browser.

Solution
Create a whitelist in Firefox settings (about:config) by adding comma delimited list of domains to network.automatic-ntlm-auth.trusted-uris

Example: myintranet, www.mydomain.com, etc

References
"Integrated Authentication - MDC." Mozilla Developer Center - MDC. Web. 23 Mar. 2010.
<https://developer.mozilla.org/En/Integrated_Authentication>.

Membership.DeleteUser() Throws REFERENCE constraint Error

Problem

Membership.DeleteUser("myMembershipUser")

Threw the following error:

The DELETE statement conflicted with the REFERENCE constraint "FK__aspnet_Me__UserI__15502E78". The conflict occurred in database "MyDatabase", table "dbo.aspnet_Membership", column 'UserId'.
The statement has been terminated.


Solution

This particular issue was resolved by adding SELECT permission to view vw_aspnet_MembershipUsers:
  

use [MyDatabase]

GO

GRANT SELECT ON [dbo].[vw_aspnet_MembershipUsers] TO [MyDatabaseUser]

GO

References

"Membership.deleteUser error - ASP.NET Forums." Forums.asp.net - Home. Web. 05 Feb. 2010.
<http://forums.asp.net/t/1254087.aspx>.

App_GlobalResources maps to a directory outside this application, which is not supported.

Problem

Error thrown when virtual folder has trailing backslash at end of Local Path setting in IIS.

Solution

Remove trailing backslash at end of Local Path setting in IIS of virtual folder.

Error message in ASP.NET v2.0
Server Error in '/MyBadVirtualFolder/MyApplicationFolder' Application.
The path '/MyBadVirtualFolder/MyApplicationFolder/App_GlobalResources/' maps to a directory outside this application, which is not supported.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Error message in ASP.NET v1.1
Server Error in '/MyBadVirtualFolder/MyApplicationFolder' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
References
brutter. "App_GlobalResources maps to a directory outside this application, which is not supported. - ASP.NET Forums." Forum. 19 Sept. 2005. Forums.asp.net - Home. Web. 22 Jan. 2010.
<http://forums.asp.net/t/889911.aspx>.

Google on SEO (Search Engine Optimization)

References

"Google's Search Engine Optimization Starter Guide" Official Google Webmaster Central Blog. 13 Nov. 2008. Web. 22 Jan. 2010. [PDF file]
<http://www.google.com/webmasters/docs/search-engine-optimization-starter-guide.pdf>.


"Google's SEO Starter Guide." Official Google Webmaster Central Blog. Web. 22 Jan. 2010.
<http://googlewebmastercentral.blogspot.com/2008/11/googles-seo-starter-guide.html>.


"Google SEO resources for beginners." Official Google Webmaster Central Blog. Web. 22 Jan. 2010.
<http://googlewebmastercentral.blogspot.com/2010/01/google-seo-resources-for-beginners.html>.

Windows Explorer Command-Line Options for Windows XP

BAT file code
@echo off
start %SystemRoot%\explorer.exe /n,/root, "C:\MyFolder"


References
"Explorer.exe Command-Line Options for Windows XP." Microsoft Support. Web. 24 Dec. 2009. <http://support.microsoft.com/kb/314853>.

The options that you can use with Explorer.exe are /n, /e, /root (plus an object), and /select (plus an object).

Option            Function
----------------------------------------------------------------------
/n Opens a new single-pane window for the default
selection. This is usually the root of the drive that
Windows is installed on. If the window is already
open, a duplicate opens.

/e Opens Windows Explorer in its default view.

/root,<object> Opens a window view of the specified object.

/select,<object> Opens a window view with the specified folder, file,
or program selected.

CSS Nested Lists

  

<ol style="list-style-type: decimal;">

<li>aaa

<ol style="list-style-type: lower-alpha;">

<li>aaa</li>

<li>bbb

<ol style="list-style-type: lower-roman;">

<li>aaa</li>

<li>bbb</li>

<li>ccc</li>

</ol>

</li>

<li>ccc</li>

</ol>

</li>

<li>bbb</li>

<li>ccc</li>

</ol>

  1. aaa
    1. aaa
    2. bbb
      1. aaa
      2. bbb
      3. ccc
    3. ccc
  2. bbb
  3. ccc

How to Debug JavaScript

Problem
Debugging JavaScript in Firefox
Debugging JavaScript in IE

Solution for Debugging JavaScript in Firefox

Firebug Method:
  1. Open page to debug in Firefox
  2. Start Firebug
  3. Click on the "Script" tab on top of Firebug pane
  4. Assign break points and step through code as you would with VS2005
Solution for Debugging JavaScript in IE6

Debugger line method:
  1. IE: Tools/Internet Options/Advanced Tab/Uncheck "Disable Script Debugging"
  2. VS: Add following line to JavaScript code:
    debugger;
  3. Add breakpoint to line above
  4. Remove line above after debugging complete
VS2005 Attach to Process Method:
  1. IE: Tools/Internet Options/Advanced Tab/Uncheck "Disable Script Debugging"
  2. VS: Solution Explorer/Right-Click .ASPX/View in Browser
  3. VS: Debug/Attach to Process...
    1. Attach to: Click Select.../Check Script
    2. Available Processes/Select iexplore.exe of .ASPX
    3. Click Attach
  4. VS: Debug/Windows/Script Explorer
  5. VS Script Explorer: Double-Click page to open scipt for setting break points

Visual Studio Documentation Comments for C#

Tip
Include XML Documentation Comments in C# code:

<c>
<code>
<example>
<exception>
<include>
<list>
<para>
<param>
<paramref>
<permission>
<remarks>
<returns>
<see>
<seealso>
<summary>
<typeparam>
<typeparamref>
<value>

References
"Recommended Tags for Documentation Comments (C#)." MSDN: Microsoft Development, MSDN Subscriptions, Resources, and More. Web. 02 Dec. 2009.
<http://msdn.microsoft.com/en-us/library/5ast78ax%28VS.80,loband%29.aspx>.

SQL Server Management Studio Default My Projects Location

Problem
Need to change default location of My Projects folder in SSMS

Solution for SSMS 2008
Had to add a new registry entry "VisualStudioProjectsLocation" of type "Expandable String Value" (REG_EXPAND_SZ) at
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell

Solution That Worked for SSMS 2005
Modify registry entry "VisualStudioProjectsLocation" at
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell

References for Solution That Worked for SSMS 2005
"How to change the default ‘My Projects’ location in SQL Server Management Studio «." Pepper's Perspective. Web. 15 Sept. 2009. <http://p3john.wordpress.com/2009/08/11/how-to-change-the-default-my-projects-location-in-sql-server-management-studio/>.


Solution That Did Not Work for SSMS 2005
This solution did not work for me. After saving vssettings file, SSMS regenerated the settings file with the old values on the next start after displaying message "Microsoft SQL Server Management Studio is configuring the environment for first time use. This might take a few minutes."

Manually modify SSMS *.vssettings XML file at location:
\My Documents\SQL Server Management Studio\Settings\

See entry:
<PropertyValue name="ProjectsLocation">%vsspv_visualstudio_dir%\Projects</PropertyValue>
References for Solution That Did Not Work for SSMS 2005
"Changing the My Projects folder location (and other settings) in SSMS :." Visual Studio Hacks. Web. 15 Sept. 2009.
<http://visualstudiohacks.com/tips/options/changing-the-my-projects-folder-location-and-other-settings-in-ssms/>.

Updates
2011-07-05 Added SSMS 2008 references.

INSERT failed because the following SET options have incorrect settings: 'ARITHABORT'.

Problem

Received the following error while performing CREATE Procedure from Visual Studio 2005 after setting up a DDL trigger for database auditing in a SQL Server 2005 database.
INSERT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods.

Solution 1

Added the following line to the DDL auditing database trigger:

SET ARITHABORT ON


Solution 1 References

"Database DDL trigger." Community Bookmarks - MSDN. Web. 19 Aug. 2009.
http://social.msdn.microsoft.com/Forums/en-US/sqlreplication/thread/8333dc82-7390-4145-8081-74d9330938dd.

"SET ARITHABORT (Transact-SQL)." MSDN: Microsoft Development, MSDN Subscriptions, Resources, and More. Web. 19 Aug. 2009.
http://msdn.microsoft.com/en-us/library/ms190306%28SQL.90%29.aspx.

"Behavior When ARITHABORT and ARITHIGNORE Are Set to ON." MSDN: Microsoft Development, MSDN Subscriptions, Resources, and More. Web. 19 Aug. 2009.
http://msdn.microsoft.com/en-us/library/ms189118%28SQL.90%29.aspx.


Solution 2

Found that the database that was throwing the error was configured to be compatible with an older version of SQL Server. Setting the database to be compatible with SQL Server 2005 also corrected the problem.

Solutin 2 References

"Reorg failing - SELECT failed because the following SET options have incorrect settings: 'ARITHABORT'" Community Bookmarks - MSDN. Web. 17 Aug. 2009.
http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/41bf9b3a-ee25-4dde-bf6f-ab1a8d59ea6b.

"Sp_dbcmptlevel (Transact-SQL)." MSDN: Microsoft Development, MSDN Subscriptions, Resources, and More. Web. 17 Aug. 2009.
http://msdn.microsoft.com/en-us/library/ms178653(SQL.90).aspx.