cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ahandler
Engaged Sweeper
If i start server - i get this error in errorlog. Clients cannot get connection so server.

#####################################################

28.02.2008 09:16:56
System.Data.SqlClient.SqlException: Cannot open database "Lansweeper" requested by the login. The login failed.
Login failed for user 'lssqluser'.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Lansweeper30.starter.startsweeper()

#####################################################

If i stopp service and start it again, there is no error.

Looking forward for an answer.

Regards Andreas
22 REPLIES 22
Hemoco
Lansweeper Alumni
Are your service and database on the same server?
I think that when you boot up the computer the lansweeper service starts before sql server is started (that would explain why the error is solved later)

open regedit, go to this key

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Lansweeper Pro


Create a new reg_multi_sz (multi string) value = DependOnService

In this value, type the name of your sqlserver service (you can find the name in the same registry hive)
This is most likely MSSQLSERVER or MSSQL$SQLEXPRESS
ahandler
Engaged Sweeper
I checked the string - string seems to be ok, but here it is.


<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="ConnectionString" value="Persist Security Info=False;Data Source=127.0.0.1\sqlexpress;Initial Catalog=Lansweeper;User ID=lssqluser;Password=password" />
<add key="ConcurrentThreads" value="10" />
<add key="ListenPort" value="9524" />
</appSettings>
</configuration>

If the config is incorrect, there would be also no connection if i restart the service -> but it works if it restart it...

-> The Server is 2003 and a virtual machine

Regards Andy
Hemoco
Lansweeper Alumni
[qoute]System.Data.SqlClient.SqlException: Cannot open database "Lansweeper" requested by the login. The login failed.
Login failed for user 'lssqluser'.
Check your lansweeper30.exe.config connectionstring and your database.

This error means that lssqluser can't logon to the database (wrong password, no access, ...)