This project has moved. For the latest updates, please go here.

Database connection error

Nov 13, 2011 at 2:34 PM

Sorry, but I'm completely clueless when it comes to SQL Server.

Trying to install the current release. The database information in the database configuration dialog looks OK, and the Test button reports a successful connection to the database. But the Test button in the Edit Profile dialog fails, with the following report:

StackHash.AdminReportException
Message: StackHashBusinessObjects.StackHashException :  : Cannot open database "WZ" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'., System.Data.SqlClient.SqlException :  : Cannot open database "WZ" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.,
Data: System.Collections.ListDictionaryInternal
InnerException:
TargetSite:
StackTrace:
HelpLink:
Source:

StackHash 1.30.20011.2
Command Line: "C:\Program Files (x86)\StackHash\StackHash.exe"
Current Directory: C:\Program Files (x86)\StackHash
Framework: 4.0.30319.1
Machine Name: DELL780
OS: Microsoft Windows NT 6.1.7600.0
x64: True
Processors: 2
Current Culture: en-US
Current UI Culture (for current thread): en-US
Administrator: False

Service Error Code: NoError

If I try to enable the profile, I get a different error:

System.ServiceModel.FaultException`1[[StackHash.StackHashService.ReceiverFaultDetail, StackHash, Version=1.30.20011.2, Culture=neutral, PublicKeyToken=null]]
Detail: StackHash.StackHashService.ReceiverFaultDetail
Action:
Code: System.ServiceModel.FaultCode
Message: Cannot open database "WZ" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Reason: Cannot open database "WZ" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Data: System.Collections.ListDictionaryInternal
InnerException:
TargetSite: Void HandleReturnMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessage)
StackTrace:
Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at StackHash.StackHashService.IAdminContract.ActivateStackHashContext(ActivateStackHashContextRequest requestData)
   at StackHash.ClientLogic.WorkerActivateStackHashContext(WorkerArgActivateStackHashContext arg)
HelpLink:
Source: mscorlib

StackHash 1.30.20011.2
Command Line: "C:\Program Files (x86)\StackHash\StackHash.exe"
Current Directory: C:\Program Files (x86)\StackHash
Framework: 4.0.30319.1
Machine Name: DELL780
OS: Microsoft Windows NT 6.1.7600.0
x64: True
Processors: 2
Current Culture: en-US
Current UI Culture (for current thread): en-US
Administrator: False

Service Error Code: FailedToDetermineIfControlEntryExists

Tried many times, but I really don't know what to do. For the record, this is 64-bit Windows 7.  SQL Server 2005, 2005 Compact Edition, 2008, and 2008 R2 appear to all be installed. There is a folder for the 'WZ' database, but it's empty.

TIA,

Chris

Coordinator
Nov 13, 2011 at 4:10 PM

Hi Chris,

You need to do one of two things.

Run the StackHash service using the same login that you installed StackHash. You can do this in the Service Control Manager in Control Panel, Adminstrative Tools. Right click the StackHash service and set the login credentials.

 

OR...

 

Install the SQL Server Management Studio http://www.microsoft.com/download/en/details.aspx?id=22985

Once installed, load up SQL Server Management Studio.

Expand Security/Login and ensure that there is an entry for NT AUTHORITY\NETWORK SERVICE. Once created, double click it and select Server Roles - make sure the sysadmin is checked.

Now try running StackHash again.

Nov 13, 2011 at 11:04 PM

Hi Mark,

Thanks for the response. I've had a Microsoft kind of day. Essentially everything SQL Server-related that I've tried to install or uninstall has errored out. At a certain point you just want to aim a shotgun at the box and pull the trigger.

I'll try again tomorrow.

Nov 14, 2011 at 3:10 PM

This was NOT FUN, but I finally got it working. :) 

Thanks!

Coordinator
Nov 14, 2011 at 4:10 PM

Hi Chris,

Which route did you use? Setting the stackhash service login credentials or installing SQL server management studio and setting the security for the database?

Cheers

Mark

Nov 14, 2011 at 5:04 PM

I used SQL Server Management Studio. For future reference, let me mention two of the many problems I had:

1. There are a lot of SQL Server install packages, and they don't all include Management Studio.  The one I found that actually installed without error and included Management Studio was SQLEXPRWT_x64_ENU.exe at http://www.microsoft.com/download/en/details.aspx?id=23650

2. In order for Security/Logins to show up, you have to be connected (duh). But I couldn't connect because I didn't know what the server name was, and the server name dropdown was empty except for  the Browse entry, which led me nowhere useful. The correct name eventually turned out to be "(local)".

I'm sure this is SQL tyro stuff, but I'm just a programmer. What do I know from SQL installations? :)

Thanks again for your help.