.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘Box’

How to enable SQL Server connectivity on Windows XP Service Pack 2

Symptoms
This article describes how to enable SQL Server connectivity on Windows XP Service Pack 2.
By default, Windows Firewall is enabled on computers that are running Microsoft Windows XP Service Pack 2. Windows Firewall closes ports such as 445 that are used for file and printer sharing to prevent Internet computers from connecting to file and print shares on your computer or to other resources. When SQL Server is configured to listen for incoming client connections by using named pipes over a NetBIOS session, SQL Server communicates over TCP ports and these ports must be open. SQL Server clients that are trying to connect to SQL Server will be not be able to connect until SQL Server is set as an exception in Windows Firewall. To set SQL Server as an exception in Windows Firewall, use the steps that are listed in the “More Information” section.
Resolution
Create an exception for each instance of SQL Server The following method will open User Datagram Protocol (UDP) port 1434 in addition to the Transmission Control Protocol (TCP) port. If you want to open these ports manually, see the following article in the Microsoft Knowledge Base:
841252?(http://support.microsoft.com/kb/841252/) How to manually enable TCP/IP on Windows XP Service Pack 2 for SQL Server 2000
Note If you are running multiple instances of SQL Server, you will have to create an exception for each instance. Click Start, and then click Run. In the Run dialog box, type Firewall.cpl, and then click OK.In the Windows Firewall dialog box, click Add a Program on the Exceptions tab.In the Add Program dialog box, you can select an instance of SQL Server or you can click the Browse button to locate the instance of SQL Server that you want to add to the exception list. The default installation locations for SQL Server are listed in the following table.

Collapse this tableExpand this table
VersionFile pathSQL Server 7.0 Mssql\Binn\Sqlservr.exeSQL Server 2000 Default InstanceProgram Files\Microsoft SQL Server\Mssql\Binn\Sqlservr.exeSQL Server 2000 Named InstanceProgram Files\Microsoft SQL Server\Mssql$instancename\Binn\Sqlservr.exeSQL Server 2005 Default InstanceProgram Files\Microsoft SQL Server\MSSQL.x\MSSQL\Binn\sqlservr.exeSQL Server 2005 Named InstanceProgram Files\Microsoft SQL Server\MSSQL.x\MSSQL\Binn\sqlservr.exe
Note Each SQL Server 2005 instance is made up of a distinct set of services with specific settings for collations and other options. The directory structure, registry structure, and service names all reflect the specific instance ID of the SQL Server instance that is created during SQL Server 2005 Setup. x is the instance ID of the SQL Server instance that is created during SQL Server 2005 Setup.Select the name of the instance, and then click OK.Under Programs and Services, select the check box that is next to the name you selected in step 6, and then click OK. How to use Multiprotocol Remote Procedure Call (RPC)If you are using Multiprotocol, you must perform the steps in the “Create an exception for each instance of SQL Server” section as well as open the correct TCP ports on Windows Firewall.How to run RPC over TCPWarning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.
To run RPC over TCP, follow these steps:Enable port 135 on Windows Firewall. To do this, follow these steps: Click Start, and then click Run.In the Run dialog box, type Firewall.cpl, and then click OK.On the Exceptions tab, click Add Port. In the Port number box, type 135, and then click the TCP button.In the Name box, type a name for the port such as MULTI, and then click OK.On the Exceptions tab, you will see the new service. To enable the port, click to select the check box next to your new service, and then click OK.Modify the \\HKLM\SOFTWARE\Policies\Microsoft\Windows NT\RPC registry key.
Note If you have just installed SQL Server, this registry key does not exist. You will have to create the key and set the value. To do this, follow these steps: Click Start, and then click Run.In the Run dialog box, type Regedit, and then click OK. This will start Registry Editor.Locate the \\HKLM\SOFTWARE\Policies\Microsoft\Windows NT\RPC Registry key.Set the RestrictRemoteClients key to 0. Quit Registry EditorRestart the computer that is running SQL Server.How to use RPC over Named PipesIf you are running RPC over Named Pipes, you must open port 445 on Windows Firewall. To do this, follow these steps: Click Start, and then click Run.In the Run dialog box, type Firewall.cpl, and then click OK.On the Exceptions tab, click Add Port. In the Port number box, type 445, and then click the TCP button.In the Name box, type a name for the port such as MULTI, and then click OK.On the Exceptions tab, you will see the new service. To enable the port, click to select the check box next to your new service, and then click OK.

Error message when you use SQL Server Management Studio to connect to SQL Server 2005 Integration Services from a client computer: “Connect to SSIS Service on machine ‘<SSISServer>’ failed …

Symptoms
Consider the following scenario. A server is running Microsoft SQL Server 2005 Integration Services (SSIS). From a client computer, you use SQL Server Management Studio to connect to Integration Services on the server. To connect to Integration Services on the server, you use auser account that is not a member of the Administrators group on the server. In this scenario, you receive the following error message:

Cannot connect to SSISServer
Additional information:Failed to retrieve data for this request (Microsoft.SqlServer.SmoEnum)
Connect to SSIS Service on machine “SSISServer” failed: Access is denied.Note In this error message, SSISServer is a placeholder for the name of the server or for the IP address of the server.
However, you can successfully connect to Integration Services on the server locally by using the same user account that you used to connect to Integration Services from the client computer.
Resolution
To work around this problem, follow these steps:On the client computer, enable Windows Management Instrumentation (WMI) for remote administration. To do this, follow these steps:Click Start, click Run, type gpedit.msc, and then click OK.In the Group Policy Object Editor, expand Computer Configuration, expand Administrative Templates, and then expand Network.Expand Network Connections, expand Windows Firewall, and then click Domain Profile.Right-click Windows Firewall: Allow remote administration exception, and then click Properties.
Note In Windows Vista, right-click Windows Firewall: Allow inbound remote administration exception.In the Windows Firewall: Allow remote administration exception Properties dialog box, click Enabled, and then click OK.
Note In Windows Vista, the dialog box is the Windows Firewall: Allow inbound remote administration exception dialog box.On the server and on the client computer, specify that DCOM is available for all Microsoft COM applications. To do this, follow these steps:Click Start, click Run, type dcomcnfg, and then click OK.In the Component Services dialog box, expand Component Services, expand Computers, right-click My Computer, and then click Properties.In the My Computer Properties dialog box, click the Default Properties tab.On the Default Properties tab, click to select the Enable Distributed COM on this computer check box, and then click OK.On the server, add the user account to the Distributed COM Users group. To do this, follow these steps:Click Start, click Run, type lusrmgr.msc, and then click OK.In the Local Users and Groups dialog box, click Groups, and then double-click Distributed COM Users.In the Distributed COM Users Properties dialog box, click Add.In the Select Users dialog box, type the user name under Enter the object names to select, and then click OK two times.On the server, grant theappropriate permissions for the MsDtsServer DCOM application. To do this, follow these steps:Click Start, click Run, type dcomcnfg, and then click OK.In the Component Services dialog box, expand Component Services, expand Computers, and then expand My Computer.Expand DCOM Config, right-click the MsDtsServer object, and then click Properties.In the MsDtsServer Properties dialog box, click the Security tab.Under Launch and Activation Permissions, click Customize, and then click Edit.In the Launch Permission dialog box, click Add.In the Select Users or Groups dialog box, type the user name under Enter the object names to select, and then click OK.In the Launch Permission dialog box, click the user name under Group or user names.Under Permissions for UserName, click to select the Allow check box for the following permissions:Local LaunchRemote LaunchLocal ActivationRemote ActivationNote UserName is a placeholder for the user name that you clicked in step h.Click OK.In the MsDtsServer Properties dialog box, click Customize under Access Permissions, and then click Edit.In the Access Permission dialog box, click Add.In the Select Users or Groups dialog box, type the user name under Enter the object names to select, and then click OK.In the Access Permission dialog box, click the user name under Group or user names.Under Permissions for UserName, click to select the Allow check box for the following permissions:Local AccessRemote AccessClick OK two times.Restart the SQL Server Integration Services service.