A personal repository of technical notes. - CSC

KB955706 0x2B33

Problem
Received the following error during Microsoft Update:

The following updates were not installed:
Microsoft SQL Server 2005 Service Pack 3 (KB955706)

Error Code: 0x2B33


Solution
1) Located the error logs after reading Microsoft Discussion (see References below):
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\Summary.txt
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\SQL9_Hotfix_KB955706_sqlrun_sql.msp.log

2) Found this information in Summary.txt:
**********************************************************************************
Products Disqualified & Reason
Product Reason
Analysis Services (MSSQLSERVER) Service was found to be disabled

...

**********************************************************************************
Summary
Service was found to be disabled
Exit Code Returned: 11059

3) Set the following Windows service Startup Type to Manual:
SQL Server Analysis Services (MSSQLSERVER)

4) Reran Microsoft Update successfully

References
"Error Code: 0x2B33 KB960082 Failed in Windows Update." Microsoft Corporation. 03 Apr. 2009
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?&query=KB955706+0x2B33&lang=en&cr=US&guid=&sloc=en-us&dg=microsoft.public.windowsupdate&p=1&tid=2d23c773-f4ec-405c-976c-c444694c6700

How to Convert an ASP.NET Control to String

Problem
Need to generate an HTML string from an ASP.NET web control created in code-behind without rendering it on the web page.

Solution
Use the control's RenderControl() method with a StringWriter to generate the HTML.
  

// Code sample of a utility method to convert a control to an HTML string

public static string RenderControlToString(Control control)

{

string renderedControl = null;

if (control != null)

{

using (StringWriter tempStringWriter = new StringWriter())

{

using (HtmlTextWriter tempHtmlTextWriter = new HtmlTextWriter(tempStringWriter))

{

control.RenderControl(tempHtmlTextWriter);

renderedControl = tempStringWriter.ToString();

tempHtmlTextWriter.Close();

}

tempStringWriter.Close();

}

}

return renderedControl;

}

// Test Utility Method

private void TestRenderControlToString()

{

HyperLink testHyperLink = new HyperLink();

testHyperLink.NavigateUrl = "/MyWebFolder/Default.aspx";

testHyperLink.Text = "Hyper Link Value";

testHyperLink.Target = "_blank";

string renderedControl = Utility.RenderControlToString(testHyperLink);

Response.Write(Server.HtmlEncode(renderedControl));

Response.Write(renderedControl);

}


References
"Control.RenderControl Method (System.Web.UI)." MSDN: Microsoft Development, MSDN Subscriptions, Resources, and More. 27 Mar. 2009
http://msdn.microsoft.com/en-us/library/system.web.ui.control.rendercontrol(VS.80).aspx.

"StringWriter Class (System.IO)." MSDN: Microsoft Development, MSDN Subscriptions, Resources, and More. 27 Mar. 2009
http://msdn.microsoft.com/en-us/library/system.io.stringwriter(VS.80).aspx.

SQL CASE Examples

-- --------------------------------------------------
-- Simple CASE function:
-- --------------------------------------------------
CASE input_expression
      WHEN when_expression THEN result_expression
      ELSE else_result_expression
END

-- --------------------------------------------------
-- Searched CASE function:
-- --------------------------------------------------
CASE
      WHEN Boolean_expression THEN result_expression
      ELSE else_result_expression
END

-- CASE with multiple values tested
CASE
      WHEN t1.Column1 IN(103,109,83) THEN 'PassedTest'
      ELSE NULL
END

-- --------------------------------------------------
-- SELECT calculation
-- --------------------------------------------------
SELECT
(2 *
      CASE @RequestedSchedule
            WHEN 'M' THEN @intMonthly
            WHEN 'Q' THEN @intQuarterly
            ELSE 'Unexpected Value in RequestedSchedule: ' + @RequestedSchedule
      END
)

-- --------------------------------------------------
-- SELECT CASE EXISTS
-- --------------------------------------------------
SELECT
      a.Column01
      ,a.Column02
      ,CASE WHEN EXISTS (SELECT z.Column05 FROM TableZ AS z WHERE zColumn06 = a.Column01)
            THEN 'Exists'
            ELSE 'Not Exists'
      END
FROM
      TableA AS a

-- --------------------------------------------------
-- Set selection mode based upon passed parameters
-- --------------------------------------------------
DECLARE
      @currentSelectionMode int
      ,@selectionModeByAAA int
      ,@selectionModeByBBB int
SELECT
      @selectionModeByAAA = 1
      ,@selectionModeByBBB = 2

SELECT @currentSelectionMode =
      CASE
            WHEN @passedValue01 IS NOT NULL THEN @selectionModeByAAA
            WHEN @passedValue02 IS NOT NULL THEN @selectionModeByBBB
            ELSE 0
      END

IF (@currentSelectionMode = 0)
BEGIN
      RAISERROR('No valid selection criteria was passed.', 11, 1)
      -- Ths first number, severity, is the user-defined severity level associated with this message.
      -- Severity levels from 0 through 18 can be specified by any user.
      -- NOTE: Must be >= 11 in order to throw an error in C#
      RETURN -1
END

WRT54G Connection To Motorola Modem

Problem
Unable to connect through to internet from Linksys WRT54G router to Motorola 2110-02-1002 DSL modem.

Solution
Had to change IP address of router from 192.168.1.1 to 192.168.2.1 even though modem IP address is 192.168.1.254

Was able to keep PPPoE on modem and did not have to enable PPPoE on the router.

References
"Setting-Up a Router with DSL Internet Service" Linksys Easy Answers (Page 1 of 121). 19 Mar. 2009
http://linksys.custhelp.com/cgi-bin/linksys.cfg/php/enduser/std_adp.php?p_faqid=3687&lid=3973237401B07.

How to Convert "File System" web site to "HTTP" web site in VS2005

Problem
Need to convert "File System" web site to "HTTP" web site in Visual Studio 2005.

For sample reason to convert, see "Server-Side Include "Failed to map the path"" CSC - Technical Notes. 24 Feb. 2009
http://csc-technicalnotes.blogspot.com/2008/12/server-side-include-virtual-failed-to.html.

Solution
1) Set up application in IIS for web site
- Directory: Select existing File System web site folder in solution

2) In IIS, set the directory to the existing File System web site folder in solution

3) Remove File System web site from solution
- Right-click File System web site in Solution Explorer
- Remove

4) Add HTTP web site to solution
- Solution Explorer/Right-click Solution/Add/Existing Web Site
- Add Existing Web Site Dialog/Click "Local IIS"
- Under "Local Internet Information Server", select virtual folder created above
- Open

5) Bind web site code to old VSS location
- VS2005/File/Source Control/Change Source Control
- Select HTTP web site from list
- Click "Bind" button
- Log into VSS if necessary
- VSS/Select project folder of old File System web site
- OK
- If Status = "Valid"
- OK
- Select "Allow these files to be replaced by their server versions"
- OK
- Done

- If Status = "Invalid",
- Cancel
- "Microsoft Visual Studio needs to reopen source control database connections for projects in the solution. Your source control provider may prompt for your credentials."
- OK

- NOTE: Performing 1 or more of the following tasks may enable the binding to be "Valid":
1: [This alone should work] Close VS and delete solution *.suo file.
2: Check one file from new web site into VSS. This will be created in a VSS default location.
3: Delete all files named "vssver.scc" in web site folders and sub-folders from Windows Explorer
- Retry steps under "Bind web site code to old VSS location"
- Delete project and file from VSS that was created during step "2:" above.
- This error may be thrown:
 Unexpected error encountered. It is recommended that you restart the application as soon as possible.
Error: Unspecified error
File: vsee\pkgs\vssprovider\abstractionlayerdispatcher.cpp
Line number: 4720

Visual Studio Remove "Find and Replace" "Find In Files" "Look In" MRU Entries

Problem
Need to remove obsolete items from most recently used (MRU) Find items in Visual Studio.

Solution
The entries are located at this registry location:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\ {Visual Studio Version} \Find

References
None

Xml.DocumentSource Will Not Load With Physical Path

Problem
ASP.NET Xml control will not load with physical path when XML file is not part of website. The following error is thrown:

Server Error System.Web.HttpException: 'c:\MyFolder\MyFile.xml' is a physical path.

Property System.Web.UI.WebControls.Xml.DocumentSource may not be a physical path to the requested XML file. It must be a virtual path that is a relative or root relative URL.

Solution
Tested on .NET Framework version 1.1.

1) Instantiate an XmlDocument using physical path.
2) Assign XmlDocument to Xml control

Example using a physical path:

<asp:xml id="xmlControl" transformsource="style.xslt" runat="server"></asp:xml>

...

protected System.Web.UI.WebControls.Xml xmlControl;

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.Load("C:\MyFolder\MyFile.xml");

xmlControl.Document = xmlDoc;


Example using a website path:

<asp:xml id="xmlControl" transformsource="style.xslt" runat="server"></asp:xml>

...

protected System.Web.UI.WebControls.Xml xmlControl;

xmlControl.DocumentSource = "/MyWebSiteFolder/MyXml.xml";


References
"Xml Class." MSDN: Microsoft Development, MSDN Subscriptions, Resources, and More. 20 Feb. 2009 http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.xml(VS.71).aspx

"XmlDocument Class." MSDN: Microsoft Development, MSDN Subscriptions, Resources, and More. 20 Feb. 2009 http://msdn.microsoft.com/en-us/library/system.xml.xmldocument(VS.71).aspx

Make Property or Class Obsolete

Problem
Need to make class property obsolete so developers will not use it.

Solution
Set property to "obsolete" in code to cause a compile warning or error:
 [System.Obsolete("Deprecated: Don't use OldWay; use NewWay instead", true)]
public string Xxx
{
get
set
}
References
"Obsolete (C#)." MSDN: Microsoft Development, MSDN Subscriptions, Resources, and More. 18 Feb. 2009
http://msdn.microsoft.com/en-us/library/22kk2b44(VS.80).aspx.

Remove Connections from MRU of Visual Studio 2005 Copy Web Site Tool

Problem
Need to remove obsolete connections from most recently used (MRU) list of Copy Web Site Tool.

Solution

To remove a connection to a remote site that still exists:
1. From the Connect to list, select the connection that you want to remove.
2. Click the Disconnect from currently selected remote site button.
(MSDN)

To remove a connection to a remote site that no longer exists, edit contents of:
C:\Documents and Settings\[user name]\Local Settings\Application Data\Microsoft\WebsiteCache\[Web Site Name]\PublishState.xml

Remove obsolete <RemoteSite> sections and corresponding <PublishStatus> sections.

References
"How to: Copy Web Site Files with the Copy Web Site Tool." MSDN: Microsoft Developer Network. 12 Feb. 2009
http://msdn.microsoft.com/en-us/library/c95809c0(VS.80).aspx.

"Copy Web Site - how to remove connections from the list - ng.asp-net-forum.visual_web_developer_2005_express - error problem solve @CodeVerge." CodeVerge.Net - error problem solve @CodeVerge. 12 Feb. 2009
http://www.codeverge.net/ng.asp-net-forum.visual_web_developer_2005_express/copy-web-site-how-to-remove-connections-from-the-list.

"Re: How to remove a Connection from Copy Web Site list?" Tech-Archive.net: The source for usenet news. 12 Feb. 2009
http://www.tech-archive.net/Archive/VisualStudio/microsoft.public.vsnet.general/2007-06/msg00003.html.

Debug Class Library Apart From ASP.NET Solution

Steps to Debug a Class Library That is Not Part of a Visual Studio ASP.NET Solution

Prepare Class Library
- Open class library in Visual Studio
- Build class library in debug mode.
- Manually copy new debug DLLs from bin\debug folder of class library to bin folder of ASP.NET application that is using this class library
- Run web site in browser to rebuild with new dlls

Start Debug Session
- Set breakpoints in code of class library
- Select menu item Debug/Attach to Process...
- Transport: Default
- Attach to/Select...: Automatically determine the type of code to debug
- OK
- Available Processes:
    (If using IIS 6) Select aspnet_wp.exe
    (If using IIS 7) Check "Show processes from all users", check "Show process in all sessions", select w3wp.exe
- Note: There may be more than one. Hold mouse over each and select appropriate version.
- Attach

NOTE: if error, "EXECUTE permission denied on object 'sp_sdidebug', database 'master', owner 'dbo'."
-May "Attach to:" "Managed Code" instead of "Automatic: T-SQL code, Managed code".

NOTE: If error, "The breakpoint will not currently be hit. The source code is different from the original version."
-Need to get newer DLLs into web application. Redo steps under "Prepare Class Library"

NOTE: If error, "The breakpoint will not currently be hit. No symbols have been laoded for this document."
-Make sure "Attach to:" is set to one of the appropriate values listed above.
-Make sure class library was built in debug mode. See "Prepare Class Library" above.
-Open or refresh web page in which you are testing class library to rebuild site using new DLLs. See "Prepare Class Library" above.

Updates
2012-08-27 Added IIS 6 and IIS 7 notes.