Error number 4060 state 1 class 11

«Fatal SQL Error 4060» occurs when you try to log on to a new application database in Microsoft Dynamics SL Symptoms In Microsoft Dynamics SL 2011, you try to log on to a new, Windows authenticated, Microsoft Dynamics SL application database. However, when you try to log on, you receive the following error message: […]

Содержание

  1. «Fatal SQL Error 4060» occurs when you try to log on to a new application database in Microsoft Dynamics SL
  2. Symptoms
  3. Cause
  4. Resolution
  5. Hotfix information for Microsoft Dynamics SL
  6. File information
  7. При попытке войти в новую базу данных приложения в Microsoft Dynamics SL появляется сообщение «Неустранимая ошибка SQL 4060»
  8. Проблемы
  9. Причина
  10. Решение
  11. Сведения об исправлении для Microsoft Dynamics SL
  12. Сведения о файлах
  13. Sql server error 4060 cannot open database requested login
  14. Asked by:
  15. Question
  16. All replies
  17. SQLServer Error: 4060, Cannot open database
  18. How to fix database SQL server error 4060?
  19. How do I resolve database error 4060 in SQL Server?
  20. Cause for SQL Server Error 4060
  21. Solution for SQL Server 4060 Error
  22. No valid credentials supplied or credentials have no permission
  23. 2. To resolve Network protocol error for sql server 4060, follow these steps:
  24. 3.Firewall Blocking issue

«Fatal SQL Error 4060» occurs when you try to log on to a new application database in Microsoft Dynamics SL

Symptoms

In Microsoft Dynamics SL 2011, you try to log on to a new, Windows authenticated, Microsoft Dynamics SL application database. However, when you try to log on, you receive the following error message:

Fatal SQL Error 4060 Occurred during Company login

Cause

This problem occurs when the user ID that you use to log on to Microsoft Dynamics SL is not mapped to the new application database in Microsoft SQL Server.

Resolution

Hotfix information for Microsoft Dynamics SL

A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Dynamics SL Service Pack that contains this hotfix as specified in the «Status» section in this article.

To resolve this problem, click the «View and request hotfix downloads» link at the top of this article to obtain the hotfix.

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft website:

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

Источник

При попытке войти в новую базу данных приложения в Microsoft Dynamics SL появляется сообщение «Неустранимая ошибка SQL 4060»

Проблемы

В Microsoft Dynamics SL 2011 вы пытаетесь войти в новую базу данных приложения Microsoft Dynamics SL с проверкой подлинности Windows. Однако при попытке входа в систему появляется следующее сообщение об ошибке:

Произошла неустранимая ошибка SQL 4060 при входе в компанию

Причина

Эта проблема возникает в том случае, если идентификатор пользователя, который вы используете для входа в Microsoft Dynamics SL, не сопоставлен с новой базой данных приложения в Microsoft SQL Server.

Решение

Сведения об исправлении для Microsoft Dynamics SL

Поддерживается исправление, выпущенное корпорацией Майкрософт. Однако это исправление предназначено для устранения только проблемы, описанной в этой статье. Применяйте это исправление только для систем, в которых наблюдаются указанные выше проблемы. Это исправление может получать дополнительное тестирование. По этой причине корпорация Майкрософт рекомендует во всех случаях, когда проблема не представляет особой важности, дождаться следующего пакета обновления для Microsoft Dynamics SL, содержащего это исправление, как указано в разделе «состояние» этой статьи. Чтобы устранить эту проблему, щелкните ссылку «просмотреть и запросить исправления» в верхней части этой статьи, чтобы получить исправление. Примечание Если возникнут дополнительные проблемы или необходимо устранить неполадки, возможно, потребуется создать отдельный запрос на обслуживание. Для дополнительных вопросов и проблем, которые не могут быть неполными для данного исправления, действуют стандартные затраты на поддержку. Чтобы создать отдельный запрос на обслуживание, посетите веб-сайт Майкрософт по следующему адресу:

Сведения о файлах

Английская версия данного исправления содержит атрибуты файлов (или более поздние версии), указанные в приведенной ниже таблице. Дата и время для этих файлов указаны в формате всемирного координированного времени (UTC). При просмотре сведений о файле они преобразуются в местное время. Чтобы узнать разницу между временем по ГРИНВИЧу и местным временем, используйте вкладку Часовой пояс в элементе » Дата и время » на панели управления. Microsoft Dynamics SL 2011

Источник

Sql server error 4060 cannot open database requested login

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Asked by:

Question

Problem: see JPEG image attached regarding the error message I get when I try to insert a single row in a table. SQL Error 4060.
I can access this database, CutSysDB, in Sql Server Management Studio, SSMS, and insert values in each of the five tables that comprise
the database which runs under Windows 7, Visual Studio 2008 Standard SP1, SQL Server Express 2008 R2 SP1.

When I try to add the first row in the empty table with my VS2008/Visual Basic 2008 project under Debug, I get the 4060 sql error.
Before you expend to much effort on this, you should first look at the following thread that Cathy is suggesting may be due to a
VS2008 SP1 install problem: Terry01 Thread — Studio Setup and Installation/Visual Studio 2008/devenv.exe

Login to SQL Server using Management studio and go to Security. Select ‘Terry-HPTerry’ login, in newly opened screen of Login Properties you will have User Mapping section. In that window give permission to databases in which this user required permission. On the lower screen, click the role db_owner. Click OK.

Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

I believe I followed your instructions, but to no avail. My Login Properties screen is included as a JPEG for your review. Where do I go from here?

By the way, when I try to create a new login I get the above screen but the master, model, msdb, tempdb and db owner check boxes are unchecked. Where do i go from there? I’ve tried a number of different combinations and none of them seem to work. I get an error message quite a bit about dbo object creating an error and login update fails.

The following is the screen I see when I try a new login as you suggested. Nothing I’ve tried will work. I can’t get a database to show in «Map Database listbox.

I could not see that the user ‘Terry-HPTerry’ is mapping with database CutSysDB. Is C:VISUAL STUDIO the database CutSysDB?

Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

Maggie, that is my question. How do I get the database into the new login? And, if I do, with your answer, what do I use as the user id, the same as the current one ‘Terry-HPTerry’?

Here is another try at trying to change my login. This happens no matter what I chose, only the object changes.

A valid user account within a database is required to access that database. User accounts are specific to a database. All permissions and ownership of objects in the database are controlled by the user account. SQL Server logins are associated with these user accounts. A login can have associated users in different databases, but only one user per database.

Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

Maggie, you are not reading or interpreting my replies to you. I ask a question and I get some info to read. I don’t mind the reading, but I expect a direct answer to my question. If you need more infor to answer it, ask.

Maggie, I’m getting more than frustrated, because nothing you’ve suggest works or makes sense to me!
I have two SSMS login ids, and none of them work. I’ve read most articles available on this subject,
including the ones you suggested. None appear to help me.
My two Login IDs are:Terry-HPTerry which is computerme as administrator and only user of this pc, and
TERRYAdministrator.

You aren’t helping me, only delaying the resolution. I believe I’ve done everything you’ve suggested,
and nothing works. What do I need to give you to get this issue resolved?

Источник

SQLServer Error: 4060, Cannot open database

March 13, 2009 at 1:35 pm

[298] SQLServer Error: 4060, Cannot open database «TestDB» requested by the login. The login failed. [SQLSTATE 42000]

[298] SQLServer Error: 18456, Login failed for user ‘DOMAINAdministrator’. [SQLSTATE 28000]

The problem is: I deleted that TestDB a day ago. It does not exist anymore!

What am I missing?

March 13, 2009 at 1:54 pm

Do you have any Jobs, Scheduled tasks or something running that connects to that DB?

March 13, 2009 at 2:07 pm

Thank you, that solved issue. I overlooked that sharepoint installation created job CDW_SHAREPOINT for that database.

March 13, 2009 at 2:10 pm

Glad I could help.. 🙂

January 31, 2022 at 3:25 am

SQL Server Strange behavior:

I have been Getting the following error massages non stop after full backup fails. this massage gets generated for each databases in this Availability Group. The job runs every night, and it call SSIS package. Both the SSIS and Job seems okay and the tricky part is that job fails once in a while like once in 10 days or so.

[298] SQLServer Error: 4060, Cannot open database «testDB» requested by the login. The login failed. [SQLSTATE 42000]

[298] SQLServer Error: 18456, Login failed for user ‘Testtest-user-sql’. [SQLSTATE 28000]

  • Server; SQL Server 2016 AG with 2 replica synchronized.
  • More than 10 databases configured in this AG
  • Backup preference; any replica

    Did I miss something here?

    January 31, 2022 at 10:00 am

    You had better started a new forum post ! Whenever I see new answers to old Questions, I skip it

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly .
    but keeping both feet on the ground wont get you anywhere :w00t:

    press F1 for solution, press shift +F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Viewing 6 posts — 1 through 5 (of 5 total)

    You must be logged in to reply to this topic. Login to reply

    Источник

    How to fix database SQL server error 4060?

    Table of Contents

    How do I resolve database error 4060 in SQL Server?

    If you use a SQL database, you may encounter SQL Error 4060 following a database migration. This is one of the many SQL Errors that administrators must deal with. SQL Error 4060 occurs on the server. As a result, the client has little control over the situation. You require an immediate solution. We’ll show you how to fix SQL Error 4060 here.

    1. sql server error 4060 cannot open database
    2. sql state 08004 sql server error 4060 or sql state 08004 error 4060
    3. fatal sql error 4060 occurred during company login
    4. unable to open the specified server database 4060
    5. error number 4060 state 1 class 11 or error number:4060,state:1,class:11
    6. server rejected the connection; access to selected database has been denied

    Cause for SQL Server Error 4060

    After migrating a website or application, users may encounter SQL Error 4060, which reads “Connection Failure: Server Rejected the Connection, Access to Selected Database Denied.” This error appears because:

    1. There were insufficient valid credentials to access the database, so access was denied
    2. Network Protocol was not enabled
    3. Access was blocked by a firewall

    Solution for SQL Server 4060 Error

    No valid credentials supplied or credentials have no permission

    The most serious problem with error 4060 in sql server is that the user did not have permission to view the database objects. They did not face this problem prior to migration because they had the necessary permission. As a result, after migration, you, as an administrator, should grant them permission.

    You must use the Transact-SQL or TSQL command to grant the privileges. This command appears to be:

    Similarly, you can grant permissions to other users based on their roles.

    This should resolve the issue. If not, move on to the next solution.

    All connections to the SQL Server Database Engine require a network protocol, which should be enabled. If not, the database will generate the 4060 error.

    For example if you encounter below error

    SQLDriverConnect: RETCODE=-1, State=37000, Native
    Error=4060 [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open
    database required.

    Resolving the SQL 4060 above is to set database to “Single User” or permissions issue. To resolve these errors:

    1. SQL 4060 above can occur when database is in “Single User” access, so set it back to Multi user access. To remove single user mode in sql server is achieved with the ALTER DATABASE statement as follows:

      ALTER DATABASE [Database_Name] SET MULTI_USER

    2. Make sure no server roles are enabled for the application login in Server Roles but only database permissions list by application provider correctly like read, write, execute etc…

    2. To resolve Network protocol error for sql server 4060, follow these steps:

    • Go to the programme’s list by clicking on “Start”
    • From the list, select “SQL Server Configuration Manager”
    • Then navigate into SQL Server Network Configuration and Protocols for machine instance>.
    • Double click on “Named Pipes”. This will open the Named Pipes Properties tab
    • Select “Yes” for the Enabled option and then OK to confirm.

    Also like the above, you also need to enabled TCP/IP.

    • Go to the list of programs by click on Start and select “TCP/IP”.
    • From the properties screen, select “Yes” on the Enabled parameter.
    • Now go to the IP Addresses tab and select “Yes” for the IP address.
    • Also check for the correctness of TCP Port.
    • Finally click “OK

    3.Firewall Blocking issue

    If neither of the preceding solutions resolves the problem, it is more likely that a firewall is preventing access to the database. To fix this, simply instruct the firewall to grant the user access. Navigate to the firewalls that have been installed and look for permissions. If it hasn’t already been granted to the user, do so.

    SQL Error 4060 can also be caused by other problems. A corresponding database, for example, may not have been properly copied into a new environment. There are also issues with rows and objects. Although these are uncommon, we recommend that you investigate them if the SQL 4060 error persists.

    Источник

  • SQL error 4060 “Server rejected the connection; Access to the selected database has been denied” is a common error usually seen after website migration in Windows servers.

    The reasons for this error include permission issues, firewall restrictions, etc.

    As a part of our Server  Management Services, we help our customers to fix SQL related errors regularly.

    Let’s today discuss the possible causes and fixes for this error.

    What causes SQL error 4060?

    Often after a migration, some users notice SQL error 4060 while applications or websites. This error states that the “Server rejected the connection; Access to the selected database has been denied“. As the error message states, access to the database was denied as the server rejected the connection.

    SQL error 4060

    To list out, the common reasons for this error include:

    • No permission to access the database using the credentials
    • Protocol not enabled
    • Firewall blocking access

    Lets us now look into each of these reasons in detail and the possible fix for them.

    Lack of Permission

    The most common reason for the error 4060 is the lack of permission for the user to access the database. After migration, it is important to ensure that all the users in the previous environment are set up in the new environment as well with the required privileges. However, this is often a frequently missed point.

    Correct permissions can be granted to the users with a proper TSQL command. A general format of the command is

    GRANT <permission> [ ,...n ]
    TO <database_principal> [ ,...n ] [ WITH GRANT OPTION ]
    [ AS <database_principal> ]

    For instance, to grant SHOWPLAN permission on the Example database to application role Moderator, TSQL command to be used is:

    USE Example;
    GRANT SHOWPLAN TO Moderator;
    GO.

    Similarly, we could grant the required privileges to the user after comparison with that of the permission in the old environment.

    Protocol not enabled

    To connect to SQL Server Database Engine you must have a network protocol enabled. If those are not enabled, it may trigger the error 4060.

    The steps to enable them are:

    • First, select Start, and in your list of programs, select SQL Server Configuration Manager.

    • Next, navigate to SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for <machine instance>.

      SQL error 4060

    • Then, double-click Named Pipes. The Named Pipes Properties screen appears.

    • From Enabled, select Yes. Then click OK.

      SQL error 4060

    • Similarly to enable TCP/IP, we can select TCP/IP as in step 2. The TCP/IP Properties screen appears.

    • Next, on the Protocol tab, ensure Yes is selected for Enabled. On the IP Addresses tab, ensure that Yes is selected for the appropriate IP Address. Also, ensure that the appropriate TCP Port is indicated. Then click ok.error 4060

    • Finally, from SQL Server Management Studio, restart the server instance.

      SQL error 4060

    Firewall blocking Access

    Firewall restrictions can also trigger the error 4060. To fix it, we need to allow access in firewall. Generally, a closed port is the most common restriction that Firewall places. To fix it, we need to open the port in the firewall for the client.

    Apart from the common reasons mentioned above, some other reasons can also trigger this error. In a rare case scenario, this error could also indicate that the corresponding database is not copied over to the new environment. Thus it is not a bad idea to cross-check if the database is actually copied over before we go for any other complex fixes.

    &nbsp;

    [Need help to fix SQL errors? We are available 24×7]

    &nbsp;

    Conclusion

    In short, lack of permission for users to access database, firewall restriction etc trigger the error 4060. Today, we discussed how our Support Engineers fix the error “Server rejected the connection; Access to the selected database has been denied”.

    PREVENT YOUR SERVER FROM CRASHING!

    Never again lose customers to poor server speed! Let us help you.

    Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

    GET STARTED

    var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

    Symptoms

    In Microsoft Dynamics SL 2011, you try to log on to a new, Windows authenticated, Microsoft Dynamics SL application database. However, when you try to log on, you receive the following error message:

    Fatal SQL Error 4060 Occurred during Company login

    Cause

    This problem occurs when the user ID that you use to log on to Microsoft Dynamics SL is not mapped to the new application database in Microsoft SQL Server.

    Resolution

    Hotfix information for Microsoft Dynamics SL

    A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Dynamics SL Service Pack that contains this hotfix as specified in the «Status» section in this article.

    To resolve this problem, click the «View and request hotfix downloads» link at the top of this article to obtain the hotfix.

    Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft website:

    http://support.microsoft.com/contactus/?ws=support

    File information

    The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

    Microsoft Dynamics SL 2011

    Changed Files

    Date

    File Version

    SWIMAPI.DLL

    29-Sept 2011

    8.0.20929.00

    SOLOMON.KERNEL.DLL

    29-Sept 2011

    8.0.20929.00

    Microsoft.dynamics.SL.Reporting.dll

    29-Sept 2011

    8.0.20929.00

    QQVIEW00.exe

    29-Sept 2011

    8.0.20929.00

    9829000.exe

    29-Sept 2011

    8.0.20929.00

    Soldb.dll

    29-Sept 2011

    8.0.20929.00

    lli.dll

    29-Sept 2011

    8.0.20929.00

    SAFMenuStrip.dll

    29-Sept 2011

    8.0.20929.00

    Toolbarenu.dll

    29-Sept 2011

    Installation information

    Install this hotfix by following the installation instructions that are included in the hotfix download.

    Prerequisites

    For information about the prerequisites for this hotfix, see the installation instructions that are included in the hotfix download.

    Restart requirement

    If you are prompted, restart the computer after you install the hotfix.

    Removal information

    You cannot remove this hotfix.

    Status

    Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

    This problem was reported as issue number 23832.

    More Information

    For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

    824684 Description of the standard terminology that is used to describe Microsoft software updates

    Need more help?

    Hi,

    I have been struggling for a while now to get connected to my SQL Server in my ASP.NET Core app. The error message I get seems simple, but I have tried almost anything I can think of. I have tried the following:

    1. Created a new user on the SQL Server and changed my SQL Connection String to use username and password instead of Trusted connection

    2. Uninstalled and re installed my SQL Server

    3. Hard coded the SQL Server name instead of using a . like we normally do

    What is working in this case is using the exact same connection string in another application and it seems to be connecting and creating my DB just fine. I am also able to log into the SQL Server via SSMS with either a user or using Windows Authentication

    Here is the stack trace of the error message when I try to create the DB using dotnet ef database update in VS code:

    fail: Microsoft.EntityFrameworkCore.Database.Connection[20004]
          An error occurred using the connection to database ‘AMS360_V3’ on server ‘localhost’.
    fail: Microsoft.EntityFrameworkCore.Query[10100]
          An exception occurred while iterating over the results of a query for context type ‘AMS360.API.Data.DataContext’.
          Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database «AMS360_V3» requested by the login. The login failed.
          Login failed for user ‘LAPTOP-E5OO5274Marius’.
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, 
    Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool,
    SqlAuthenticationProviderManager sqlAuthProviderManager)
             at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions
    userOptions)
             at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
             at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)   
             at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean 
    onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
             at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&
    connection)
             at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
             at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
             at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
             at Microsoft.Data.SqlClient.SqlConnection.Open()
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
             at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
             at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.InitializeReader(DbContext _, Boolean result)
             at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
             at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
          ClientConnectionId:2502177f-7c62-42fa-878d-0f151e3fdadc
          Error Number:4060,State:1,Class:11
    Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database «AMS360_V3» requested by the login. The login failed.
    Login failed for user ‘LAPTOP-E5OO5274Marius’.
       at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance,
    SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool, SqlAuthenticationProviderManager sqlAuthProviderManager)
       at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
       at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
       at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
       at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)    
       at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
       at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
       at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
       at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
       at Microsoft.Data.SqlClient.SqlConnection.Open()
       at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)
       at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
       at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
       at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.InitializeReader(DbContext _, Boolean result)
       at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
       at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
    ClientConnectionId:2502177f-7c62-42fa-878d-0f151e3fdadc
    Error Number:4060,State:1,Class:11
    An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Cannot open database «AMS360_V3» requested by the login. The login failed.
    Login failed for user ‘LAPTOP-E5OO5274Marius’.
    Unable to create an object of type ‘DataContext’

    If I need to provide more info like the appsettings.development.json, csproj file, program.cs or startup.cs config, please let me know

    Thanks in advance

    Marius

    hi everyone

    this problem make ma hopeless

    i read all solutions but it didn’t work

    the details is

    See the end of this message for details on invoking

    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************

    System.Data.SqlClient.SqlException (0x80131904): Cannot open database «hospital» requested by the login. The login failed.

    Login failed for user ‘Drmahmoud-PCDr mahmoud’.

    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

    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.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)

    at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)

    at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)

    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)

    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)

    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)

    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)

    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)

    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)

    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)

    at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)

    at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)

    at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)

    at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)

    at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)

    at System.Data.SqlClient.SqlConnection.Open()

    at Hospital.Form1.<Form1_Load>b__1(Object , EventArgs )

    at System.Windows.Forms.Timer.OnTick(EventArgs e)

    at System.Windows.Forms.Timer.TimerNativewindow.WndProc(Message& m)

    at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    ClientConnectionId:b746e588-fd04-4ae5-afe1-81b4c6f60ea7

    Error Number:4060,State:1,Class:11

    ************** Loaded Assemblies **************

    mscorlib

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

    —————————————-

    Hospital

    Assembly Version: 1.0.0.0

    Win32 Version: 1.0.0.0

    CodeBase: file:///C:/Users/Dr%20mahmoud/Desktop/hospital/Hospital/Hospital%20(2).exe

    —————————————-

    System.Windows.Forms

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

    —————————————-

    System.Drawing

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

    —————————————-

    System

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

    —————————————-

    System.Data

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll

    —————————————-

    System.Core

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

    —————————————-

    System.Configuration

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

    —————————————-

    System.Xml

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

    —————————————-

    System.Transactions

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll

    —————————————-

    System.EnterpriseServices

    Assembly Version: 4.0.0.0

    Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR

    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll

    —————————————-

    ************** JIT Debugging **************

    To enable just-in-time (JIT) debugging, the .config file for this

    application or computer (machine.config) must have the

    jitDebugging value set in the system.windows.forms section.

    The application must also be compiled with debugging

    enabled.

    can anyone help me ?

    SQL error 4060 “Server rejected the connection; Access to the selected database has been denied” is a common error usually seen after website migration in Windows servers.

    The reasons for this error include permission issues, firewall restrictions, etc.

    As a part of our Server  Management Services, we help our customers to fix SQL related errors regularly.

    Let’s today discuss the possible causes and fixes for this error.

    What causes SQL error 4060?

    Often after a migration, some users notice SQL error 4060 while applications or websites. This error states that the “Server rejected the connection; Access to the selected database has been denied“. As the error message states, access to the database was denied as the server rejected the connection.

    SQL error 4060

    To list out, the common reasons for this error include:

    • No permission to access the database using the credentials
    • Protocol not enabled
    • Firewall blocking access

    Lets us now look into each of these reasons in detail and the possible fix for them.

    Lack of Permission

    The most common reason for the error 4060 is the lack of permission for the user to access the database. After migration, it is important to ensure that all the users in the previous environment are set up in the new environment as well with the required privileges. However, this is often a frequently missed point.

    Correct permissions can be granted to the users with a proper TSQL command. A general format of the command is

    GRANT <permission> [ ,...n ]
    TO <database_principal> [ ,...n ] [ WITH GRANT OPTION ]
    [ AS <database_principal> ]

    For instance, to grant SHOWPLAN permission on the Example database to application role Moderator, TSQL command to be used is:

    USE Example;
    GRANT SHOWPLAN TO Moderator;
    GO.

    Similarly, we could grant the required privileges to the user after comparison with that of the permission in the old environment.

    Protocol not enabled

    To connect to SQL Server Database Engine you must have a network protocol enabled. If those are not enabled, it may trigger the error 4060.

    The steps to enable them are:

    • First, select Start, and in your list of programs, select SQL Server Configuration Manager.

    • Next, navigate to SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for <machine instance>.

      SQL error 4060

    • Then, double-click Named Pipes. The Named Pipes Properties screen appears.

    • From Enabled, select Yes. Then click OK.

      SQL error 4060

    • Similarly to enable TCP/IP, we can select TCP/IP as in step 2. The TCP/IP Properties screen appears.

    • Next, on the Protocol tab, ensure Yes is selected for Enabled. On the IP Addresses tab, ensure that Yes is selected for the appropriate IP Address. Also, ensure that the appropriate TCP Port is indicated. Then click ok.error 4060

    • Finally, from SQL Server Management Studio, restart the server instance.

      SQL error 4060

    Firewall blocking Access

    Firewall restrictions can also trigger the error 4060. To fix it, we need to allow access in firewall. Generally, a closed port is the most common restriction that Firewall places. To fix it, we need to open the port in the firewall for the client.

    Apart from the common reasons mentioned above, some other reasons can also trigger this error. In a rare case scenario, this error could also indicate that the corresponding database is not copied over to the new environment. Thus it is not a bad idea to cross-check if the database is actually copied over before we go for any other complex fixes.

    &nbsp;

    [Need help to fix SQL errors? We are available 24×7]

    &nbsp;

    Conclusion

    In short, lack of permission for users to access database, firewall restriction etc trigger the error 4060. Today, we discussed how our Support Engineers fix the error “Server rejected the connection; Access to the selected database has been denied”.

    PREVENT YOUR SERVER FROM CRASHING!

    Never again lose customers to poor server speed! Let us help you.

    Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

    GET STARTED

    var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

    • Remove From My Forums
    • Question

    • I’ve written a small MS Access 2007 program having links with the tables of SQL Server 2005 Express Edition. The problem is it worked out in development environment. But it’s giving error during production environment.

      SQL State ‘08004’

      Sql Server Error: ‘4060’

      Server rejected the connection; Access to selected database has been denied.

      How to fix this error?


      nories

    Answers

    • If they are using the SQL Express system by default it installs with the SQL Server Accounts Disabled and they only allow Trusted connections, Also the remote connections are disabled. As the sa account is a sql server account this would be disablled.


      http://www.virtualrealm.com.au — XNA Game Programming News and Resources from Downunder.

      • Proposed as answer by

        Wednesday, April 7, 2010 2:05 PM

      • Marked as answer by
        Alex Feng (SQL)
        Friday, April 9, 2010 10:03 AM

    How do I resolve database error 4060 in SQL Server?

    If you use a SQL database, you may encounter SQL Error 4060 following a database migration. This is one of the many SQL Errors that administrators must deal with. SQL Error 4060 occurs on the server. As a result, the client has little control over the situation. You require an immediate solution. We’ll show you how to fix SQL Error 4060 here.

    Errors include

    1. sql server error 4060 cannot open database
    2. sql state 08004 sql server error 4060 or sql state 08004 error 4060
    3. fatal sql error 4060 occurred during company login
    4. unable to open the specified server database 4060
    5. error number 4060 state 1 class 11 or error number:4060,state:1,class:11
    6. server rejected the connection; access to selected database has been denied

    After migrating a website or application, users may encounter SQL Error 4060, which reads “Connection Failure: Server Rejected the Connection, Access to Selected Database Denied.” This error appears because:

    1. There were insufficient valid credentials to access the database, so access was denied
    2. Network Protocol was not enabled
    3. Access was blocked by a firewall

    Solution for SQL Server 4060 Error

    1. No valid credentials supplied or credentials have no permission

    The most serious problem with error 4060 in sql server is that the user did not have permission to view the database objects. They did not face this problem prior to migration because they had the necessary permission. As a result, after migration, you, as an administrator, should grant them permission.

    You must use the Transact-SQL or TSQL command to grant the privileges. This command appears to be:

    GRANT <permission> [] TO <database_principal> [] [ WITH GRANT OPTION] [AS <database_principal>  As you can see, the first line of code grants the required permission, and the second line to a specific user.

    Similarly, you can grant permissions to other users based on their roles.

    This should resolve the issue. If not, move on to the next solution.

    All connections to the SQL Server Database Engine require a network protocol, which should be enabled. If not, the database will generate the 4060 error.

    For example if you encounter below error

    SQLDriverConnect: RETCODE=-1, State=37000, Native
    Error=4060 [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open
    database required.

    Resolving the SQL 4060 above is to set database to “Single User” or permissions issue. To resolve these errors:

    1. SQL 4060 above can occur when database is in “Single User” access, so set it back to Multi user access. To remove single user mode in sql server is achieved with the ALTER DATABASE statement as follows:

      ALTER DATABASE [Database_Name] SET MULTI_USER
    2.  Make sure no server roles are enabled for the application login in Server Roles but only database permissions list by application provider correctly like read, write, execute etc…

    2. To resolve Network protocol error for sql server 4060, follow these steps:

    • Go to the programme’s list by clicking on “Start”
    • From the list, select “SQL Server Configuration Manager”
    • Then navigate into SQL Server Network Configuration and Protocols for machine instance>.
    • Double click on “Named Pipes”. This will open the Named Pipes Properties tab
    • Select “Yes” for the Enabled option and then OK to confirm.

    Also like the above, you also need to enabled TCP/IP.

    • Go to the list of programs by click on Start and select “TCP/IP”.
    • From the properties screen, select “Yes” on the Enabled parameter.
    • Now go to the IP Addresses tab and select “Yes” for the IP address.
    • Also check for the correctness of TCP Port.
    • Finally click “OK

    3.Firewall Blocking issue

    If neither of the preceding solutions resolves the problem, it is more likely that a firewall is preventing access to the database. To fix this, simply instruct the firewall to grant the user access. Navigate to the firewalls that have been installed and look for permissions. If it hasn’t already been granted to the user, do so.

    SQL Error 4060 can also be caused by other problems. A corresponding database, for example, may not have been properly copied into a new environment. There are also issues with rows and objects. Although these are uncommon, we recommend that you investigate them if the SQL 4060 error persists.

    
    
    • Remove From My Forums
    • Question

    • I created a odbc link to sql server and also test data source it was successfully. But each
      time  I try to connect access  to a SQL Server db, I get this error message 

      Connection failed
      SQLState: 08004
      SQL server error: 4060
      Server rejected the connection;  Access to selected database has been denied.

    All replies

    • Hello,

      By the error message it seems the used credential don’t have permission to logon to the SQL Server; you or the DBA has to grant permissions first.


      Olaf Helper

      [ Blog] [ Xing] [ MVP]

      • Proposed as answer by

        Thursday, March 1, 2018 8:22 AM

    Symptoms

    In Microsoft Dynamics SL 2011, you try to log on to a new, Windows authenticated, Microsoft Dynamics SL application database. However, when you try to log on, you receive the following error message:

    Fatal SQL Error 4060 Occurred during Company login

    Cause

    This problem occurs when the user ID that you use to log on to Microsoft Dynamics SL is not mapped to the new application database in Microsoft SQL Server.

    Resolution

    Hotfix information for Microsoft Dynamics SL

    A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Dynamics SL Service Pack that contains this hotfix as specified in the «Status» section in this article.

    To resolve this problem, click the «View and request hotfix downloads» link at the top of this article to obtain the hotfix.

    Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft website:

    http://support.microsoft.com/contactus/?ws=support

    File information

    The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

    Microsoft Dynamics SL 2011

    Changed Files

    Date

    File Version

    SWIMAPI.DLL

    29-Sept 2011

    8.0.20929.00

    SOLOMON.KERNEL.DLL

    29-Sept 2011

    8.0.20929.00

    Microsoft.dynamics.SL.Reporting.dll

    29-Sept 2011

    8.0.20929.00

    QQVIEW00.exe

    29-Sept 2011

    8.0.20929.00

    9829000.exe

    29-Sept 2011

    8.0.20929.00

    Soldb.dll

    29-Sept 2011

    8.0.20929.00

    lli.dll

    29-Sept 2011

    8.0.20929.00

    SAFMenuStrip.dll

    29-Sept 2011

    8.0.20929.00

    Toolbarenu.dll

    29-Sept 2011

    Installation information

    Install this hotfix by following the installation instructions that are included in the hotfix download.

    Prerequisites

    For information about the prerequisites for this hotfix, see the installation instructions that are included in the hotfix download.

    Restart requirement

    If you are prompted, restart the computer after you install the hotfix.

    Removal information

    You cannot remove this hotfix.

    Status

    Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

    This problem was reported as issue number 23832.

    More Information

    For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

    824684 Description of the standard terminology that is used to describe Microsoft software updates

    Need more help?

    • Remove From My Forums
    • Question

    • I created a odbc link to sql server and also test data source it was successfully. But each
      time  I try to connect access  to a SQL Server db, I get this error message 

      Connection failed
      SQLState: 08004
      SQL server error: 4060
      Server rejected the connection;  Access to selected database has been denied.

    All replies

    • Hello,

      By the error message it seems the used credential don’t have permission to logon to the SQL Server; you or the DBA has to grant permissions first.


      Olaf Helper

      [ Blog] [ Xing] [ MVP]

      • Proposed as answer by

        Thursday, March 1, 2018 8:22 AM

    • Remove From My Forums
    • Question

    • I created a odbc link to sql server and also test data source it was successfully. But each
      time  I try to connect access  to a SQL Server db, I get this error message 

      Connection failed
      SQLState: 08004
      SQL server error: 4060
      Server rejected the connection;  Access to selected database has been denied.

    All replies

    • Hello,

      By the error message it seems the used credential don’t have permission to logon to the SQL Server; you or the DBA has to grant permissions first.


      Olaf Helper

      [ Blog] [ Xing] [ MVP]

      • Proposed as answer by

        Thursday, March 1, 2018 8:22 AM

    4060 «Server rejected the connection; Access to selected database has been denied».

    How can I troubleshoot this error?

    asked Apr 9, 2009 at 11:06

    Hara's user avatar

    2

    This error also occurs if the Database not exists

    so make sure that there is a database with the name you provided in
    Catalog=MyDB

    answered Aug 2, 2017 at 7:52

    Salmakis's user avatar

    SalmakisSalmakis

    2163 silver badges6 bronze badges

    Do you have permission to access the database using the credentials that you are supplying? What provider are you trying to use? TCP/IP, Named Pipes? Has that provider been enabled? Is there a firewall in place and have you opened up the port to the client? Does this happen intermittently? If so, do you have enough licenses available when the error occurs? You might want to check the server error logs (and your client event log, too) for more information.

    answered Apr 9, 2009 at 11:18

    tvanfosson's user avatar

    tvanfossontvanfosson

    519k97 gold badges697 silver badges794 bronze badges

    User credentials are ok, but user doesn’t have the right to connect to the given database, you should grant him all rights needed…

    answered Sep 24, 2012 at 16:44

    que dal's user avatar

    que dalque dal

    1391 silver badge1 bronze badge

    1

    You’re most likely don’t have the necessary permissions to access the database, or there isn’t a database which correspond to the information you specified.

    answered Apr 9, 2009 at 11:25

    Moayad Mardini's user avatar

    Moayad MardiniMoayad Mardini

    7,2315 gold badges39 silver badges58 bronze badges

    1

    February 15, 2005 at 1:58 pm

    #85090

    I moved our SQL 2000 server to a new box, installed the same software and then restored the databases from backup. Primary SQL application works with no problem. My issue is that Crystal Reports and MS Query (from Excel) both require the use of a ODBC connection (System) in order to function. When I change the server location (in the ODBC setting) to the new server, the Crystal reports will then allow them to be pointed to the new server and work. New MS Queries will also work.

    It’s the old queries that are refusing to connect. User gets an error message which says SQL State error: 08004 and the server error 4060 — Server rejected the connection; Access to selected database has been denied. Then a Server login box pops up. If I uncheck the use trusted connection and logon as sa, the query will update properly. Otherwise it bombs with the user name as the login.

    If I run the spreadsheet query with my admin logon, it will also update correctly and run.

    All users connect via a Citrix Metaframe Server and do not have PC’s. All the databases are named the same, only the server name has been changed. The OS’s are the same.

    Somewhere it would appear that a permission is missing but I can’t find it.

    Suggestions?

    Sopheap Suy

    SSCertifiable

    Points: 7893

    February 15, 2005 at 3:42 pm

    #542411

    It is normal that user login would be all messed up.  To correct the action there are a couple way to fix your problem. 

    1. EXEC sp_change_users_login ‘Update_One’, ‘Mary’, ‘NewMary’

    2. delete all user from the new server and script the user from the old server and execute it on the new server.

    Good luck.

    mom

    Bob Hoffman-209065

    Hall of Fame

    Points: 3224

    February 15, 2005 at 3:48 pm

    #542412

    The primary or front end application creates a username_sql in addition to the normal username login. I don’t think I can change one without affecting the other.

    Sopheap Suy

    SSCertifiable

    Points: 7893

    February 15, 2005 at 4:26 pm

    #542417

    That should be ok don’t you think?

    OK here is what you told me.  When you create a login, the application create another one for it’s use so that mean for each person there are 2 user id is this correct?

    Bob Hoffman-209065

    Hall of Fame

    Points: 3224

    February 15, 2005 at 4:32 pm

    #542420

    Correct, two user id’s for each user except sa.

    I believe the normal user id is created through windows login.

    Sopheap Suy

    SSCertifiable

    Points: 7893

    February 15, 2005 at 4:36 pm

    #542421

    Bob,

    if you do select name from sysuser you would be able to correct all of them.  Also make sure all the logins are created on the server first before you try to correct it. There are ways to copy logins from server a to server B (if it is sql 2000 ) and it will preserve the password if it is a Sql account too.

    mom

    A Plockyn

    SSC Veteran

    Points: 247

    Hi

    I have just experienced that issue.

    Solution: edit the server in the connection string of the SQL query in Excel:

    Open your Excel spreadsheet,

    Click in the data area (where the data should refresh, e.g. A1)

    Menu > Data > Import External Data > Edit Query

    click [Cancel] and click [Yes] to «Do you want to continue editing this query in Microsoft Query?»

    In Microsoft Query, File > Save the query

    eg: Query from Server12345_19_6_253_105.dqy

    Edit this .qqy in notepad and change the server IP or Name in the connection string

    don’t change anything else (this time around)

    Then, still in Microsoft Query, File > Open the query

    (in a second window)

    make sure you retrieve data with the new query (press ! )

    Remove the old query by clicking the corner [X]

    Quit (the open door symbol)

    Back in Excel, Data > refresh data (Although it should be already doing it)

    That’s it. Enjoy.

    Alain

    4060 «Сервер отклонил соединение, доступ к выбранной базе данных был отклонен».

    Как устранить эту ошибку?

    У вас есть разрешение на доступ к базе данных с использованием учетных данных, которые вы поставляете? Какой провайдер вы пытаетесь использовать? TCP/IP, именованные каналы? Включен ли этот провайдер? Существует ли межсетевой экран, и вы открыли порт для клиента? Это случается с перерывами? Если да, у вас достаточно лицензий, доступных при возникновении ошибки? Вы можете также проверить журналы ошибок сервера (и журнал событий вашего клиента) для получения дополнительной информации.

    Пользовательские учетные данные в порядке, но пользователь не имеет права подключаться к данной базе данных, вы должны предоставить ему все необходимые права…

    Эта ошибка также возникает, если база данных не существует

    убедитесь, что есть база данных с именем, которое вы указали в
    Каталог = MyDB

    У вас, скорее всего, нет необходимых разрешений для доступа к базе данных, или нет базы данных, которая соответствует указанной вами информации.

    Введите минимум 50 символов

    Description

    We updated the templates to skip using the database error page middleware and instead use the developer exception page middleware with an exception filter cfe158c. It seems that the templates were not updated/manually verified and as a result of that the templates are broken.

    Upon including services.AddDatabaseDeveloperPageExceptionFilter(); there is another exception thrown by the middleware.

    fail: Microsoft.EntityFrameworkCore.Database.Connection[20004]
          An error occurred using the connection to database 'aspnet-BlazorApp30.Server-680592C9-B24C-4120-A2BE-04DC4ABBCFB0' on server '(localdb)mssqllocaldb'.
    fail: Microsoft.EntityFrameworkCore.Query[10100]
          An exception occurred while iterating over the results of a query for context type 'BlazorApp30.Server.Data.ApplicationDbContext'.
          Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database "aspnet-BlazorApp30.Server-680592C9-B24C-4120-A2BE-04DC4ABBCFB0" requested by the login. The login failed.
          Login failed for user 'REDMONDjacalvar'.
             at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
             at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
             at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
             at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
             at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
             at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
             at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()
          --- End of stack trace from previous location ---
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
             at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
          ClientConnectionId:49b0608d-6a94-4bd3-9362-837292bde0c7
          Error Number:4060,State:1,Class:11
          Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database "aspnet-BlazorApp30.Server-680592C9-B24C-4120-A2BE-04DC4ABBCFB0" requested by the login. The login failed.
          Login failed for user 'REDMONDjacalvar'.
             at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
             at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
             at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
             at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
             at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
             at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
             at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()
          --- End of stack trace from previous location ---
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
             at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
          ClientConnectionId:49b0608d-6a94-4bd3-9362-837292bde0c7
          Error Number:4060,State:1,Class:11
    fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
          An unhandled exception has occurred while executing the request.
          Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database "aspnet-BlazorApp30.Server-680592C9-B24C-4120-A2BE-04DC4ABBCFB0" requested by the login. The login failed.
          Login failed for user 'REDMONDjacalvar'.
             at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
             at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
             at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
             at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
             at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
             at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
             at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
             at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
             at Microsoft.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()
          --- End of stack trace from previous location ---
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
             at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
             at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
             at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
             at Microsoft.AspNetCore.Identity.UserManager`1.FindByNameAsync(String userName)
             at Microsoft.AspNetCore.Identity.UserValidator`1.ValidateUserName(UserManager`1 manager, TUser user, ICollection`1 errors)
             at Microsoft.AspNetCore.Identity.UserValidator`1.ValidateAsync(UserManager`1 manager, TUser user)
             at Microsoft.AspNetCore.Identity.UserManager`1.ValidateUserAsync(TUser user)
             at Microsoft.AspNetCore.Identity.UserManager`1.CreateAsync(TUser user)
             at Microsoft.AspNetCore.Identity.UserManager`1.CreateAsync(TUser user, String password)
             at Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal.RegisterModel`1.OnPostAsync(String returnUrl)
             at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)
             at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
             at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()
             at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()
             at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
             at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
             at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
             at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
             at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
             at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
             at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
             at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)         at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
             at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
             at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
             at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService)
             at IdentityServer4.Hosting.MutualTlsEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes)
             at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
             at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context)
             at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
             at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
             at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
          ClientConnectionId:49b0608d-6a94-4bd3-9362-837292bde0c7
          Error Number:4060,State:1,Class:11
    fail: Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseDeveloperPageExceptionFilter[7]
          An exception occurred while calculating the database error page content. Skipping display of the database error page.
          System.NullReferenceException: Object reference not set to an instance of an object.
             at Microsoft.EntityFrameworkCore.Metadata.Internal.Model.FinalizeModel()
             at Microsoft.EntityFrameworkCore.MutableModelExtensions.FinalizeModel(IMutableModel model)
             at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.HttpContextDatabaseContextDetailsExtensions.GetContextDetailsAsync(HttpContext httpContext, Type dbcontextType, ILogger logger)
             at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseDeveloperPageExceptionFilter.HandleExceptionAsync(ErrorContext errorContext, Func`2 next)
    

    Customer Impact

    This is is a regression, customers will not be able to setup their database as part of the initial flow (as they are used to) and instead will be forced to use the command-line tools to initialize the database.

    Regression?

    YES

    Risk

    Low. Changes are focused on the templates, but the scenarios need to be verified.

    Понравилась статья? Поделить с друзьями:
  • Error number 3241
  • Error number 24 means too many open files
  • Error number 2147024891 0x80070005
  • Error number 208 state 1 class 16
  • Error number 207 state 1 class 16