Get-splogevent Correlation ID, login failed for "Edit My Profile" in My Profile Error An unexpected error has occurred

Hello Community
    Edit My Profile in My Site displayed an error that "An unexpected error occurred" with a
Correlation ID. I have tried to read the logs in the 14 hive Logs folder but unsuccessfully. 
I was able to  understand Event Viewer logs, there was supposed to be 4 possibilities
one was wheter UPS was running, the other was clearing the cache and the other 2 I also fixed
I even recreated the Search Service Application, Metadata and UPS but when I fixed the problems
the error still occurred.
    Then I used a Powershell command that displayed output but the Output doesn't make sense
because it is saying the login failed associated with the database that was created by the Search
Service application when it was created.
    But  how can that username be related to the Search Service database?  Below is the output:
Area     : SharePoint Foundation
Category : Logging Correlation Data
Level    : Medium
EventID  : xmnv
Message  : Name=Request (GET:http://site/_layouts/EditProfile.aspx?accountname=Server1%User1)
Area     : SharePoint Foundation
Category : Logging Correlation Data
Level    : Medium
EventID  : xmnv
Message  : Site=/
Area     : SharePoint Server
Category : Database
Level    : High
EventID  : 880i
Message  : System.Data.SqlClient.SqlException: Cannot open database "SrchSvc_DB_5e06e8c82d5446e39da18d70a5a7e78e" r
           equested by the login. The login failed.  Login failed for user Server1\User1.     at System.Data.SqlCli
           ent.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)     at System.Data.SqlCli
           ent.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)     at System.Data.SqlClient.TdsParser
           .Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkC
           opyHandler, TdsParserStateObject stateObj)     at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLog
           in(Boolean enlistOK)     at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo server
           Info, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)     a
           t System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean re
           directedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
              at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnecti
           onString connectionOptions, String newPassword, Boolean redirectedUserInstance)     at System.Data.SqlClient
           .SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Ob
           ject providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)     at Sy
           stem.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProvi
           derInfo, DbConnectionPool pool, DbConnection owningConnection)     at System.Data.ProviderBase.DbConnectionF
           actory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions opti
           ons)     at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)     at System.
           Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)     at System.Data.ProviderB
           ase.DbConnectionPool.GetConnection(DbConnection owningObject)     at System.Data.ProviderBase.DbConnectionFa
           ctory.GetConnection(DbConnection owningConnection)     at System.Data.ProviderBase.DbConnectionClosed.OpenCo
           nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)     at System.Data.SqlClient.S
           qlConnection.Open()     at Microsoft.Office.Server.Data.SqlSession.OpenConnection()
Area     : SharePoint Server
Category : Database
Level    : High
EventID  : 880k
Message  : at Microsoft.Office.Server.Data.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQu
           eryData monitoringData, Boolean retryForDeadLock)     at Microsoft.Office.Server.Data.SqlSession.ExecuteRead
           er(SqlCommand command, Boolean retryForDeadLock)     at Microsoft.Office.Server.Search.Administration.Schema
           Database.GetSchemaHighLevelInfo()     at Microsoft.Office.Server.Search.Administration.Schema.get_LastChange
           Time()     at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.SynchronizeManagedPropertyM
           appings(Guid partitionID, SearchServiceApplicationProxy searchAppProxy)     at Microsoft.Office.Server.Admin
           istration.UserProfileApplicationProxy.GetManagedPropertyMapping(Guid partitionID, String propertyName)     a
           t Microsoft.Office.Server.UserProfiles.Co...
Area     : SharePoint Server
Category : Database
Level    : High
EventID  : 880j
Message  : SqlError: 'Cannot open database "SrchSvc_DB_5e06e8c82d5446e39da18d70a5a7e78e" requested by the login. Th
           e login failed.'    Source: '.Net SqlClient Data Provider' Number: 4060 State: 1 Class: 11 Procedure: '' Lin
           eNumber: 65536 Server: Server1\Servers
Area     : SharePoint Server
Category : Database
Level    : High
EventID  : 880j
Message  : SqlError: 'Login failed for user Server1\User1.'    Source: '.Net SqlClient Data Provider' Number: 18456
            State: 1 Class: 14 Procedure: '' LineNumber: 65536 Server: Server1\Servers
Area     : SharePoint Server
Category : Database
Level    : High
EventID  : tzku
Message  : ConnectionString: 'Data Source=Server1\Servers;Initial Catalog=SrchSvc_DB_5e06e8c82d5446e39da18d70a5a
           7e78e;Integrated Security=True;Enlist=False;Connect Timeout=15'    ConnectionState: Closed ConnectionTimeout
           : 15
Area     : SharePoint Foundation
Category : Runtime
Level    : Unexpected
EventID  : tkau
Message  : System.Data.SqlClient.SqlException: Cannot open database "SrchSvc_DB_5e06e8c82d5446e39da18d70a5a7e78e" r
           equested by the login. The login failed.  Login failed for user Server1\User1.    at System.Data.SqlClie
           nt.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)     at System.Data.SqlClie
           nt.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)     at System.Data.SqlClient.TdsParser.
           Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCo
           pyHandler, TdsParserStateObject stateObj)     at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogi
           n(Boolean enlistOK)     at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverI
           nfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)     at
            System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean red
           irectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
             at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectio
           nString connectionOptions, String newPassword, Boolean redirectedUserInstance)     at System.Data.SqlClient.
           SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Obj
           ect providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)     at Sys
           tem.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProvid
           erInfo, DbConnectionPool pool, DbConnection owningConnection)     at System.Data.ProviderBase.DbConnectionFa
           ctory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions optio
           ns)     at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)     at System.D
           ata.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)     at System.Data.ProviderBa
           se.DbConnectionPool.GetConnection(DbConnection owningObject)     at System.Data.ProviderBase.DbConnectionFac
           tory.GetConnection(DbConnection owningConnection)     at System.Data.ProviderBase.DbConnectionClosed.OpenCon
           nection(DbConnection outerConnection, DbConnectionFactory connectionFactory)     at System.Data.SqlClient.Sq
           lConnection.Open()     at Microsoft.Office.Server.Data.SqlSession.OpenConnection()     at Microsoft.Office.S
           erver.Data.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringDat
           a, Boolean retryForDeadLock)     at Microsoft.Office.Server.Data.SqlSession.ExecuteReader(SqlCommand command
           , Boolean retryForDeadLock)     at Microsoft.Office.Server.Search.Administration.SchemaDatabase.GetSchemaHig
           hLevelInfo()     at Microsoft.Office.Server.Search.Administration.Schema.get_LastChangeTime()     at Microso
           ft.Office.Server.Administration.UserProfileApplicationProxy.SynchronizeManagedPropertyMappings(Guid partitio
           nID, SearchServiceApplicationProxy searchAppProxy)     at Microsoft.Office.Server.Administration.UserProfile
           ApplicationProxy.GetManagedPropertyMapping(Guid partitionID, String propertyName)     at Microsoft.Office.Se
           rver.UserProfiles.CoreProperty.GetManagedPropertyMapping(String propertyName)     at Microsoft.Office.Server
           .UserProfiles.CoreProperty.get_ManagedPropertyName()     at Microsoft.SharePoint.Portal.WebControls.ProfileP
           ropertyLoader.ApplyFormattingEx(ProfileManagerBase objManager, Dictionary`2 highlightedProperties, Property
           prop, Object[] propValue, Boolean ignoreFormat, Boolean allowLinkToSearch)     at Microsoft.SharePoint.Porta
           l.WebControls.ProfileUI.LoadProfileTable()     at Microsoft.SharePoint.Portal.WebControls.ProfileUI.LoadCont
           rol(Object sender, EventArgs e)     at System.EventHandler.Invoke(Object sender, EventArgs e)     at System.
           Web.UI.Control.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control
           .LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()
              at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.U
           I.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint
           , Boolean includeStagesAfterAsyncPoint)
Area     : SharePoint Foundation
Category : Monitoring
Level    : Medium
EventID  : b4ly
Message  : Leaving Monitored Scope (Request (GET:http://site/_layouts/EditProfile.aspx?accountname=Server1%User1)). Execution Time=88.6628049095625
    What does that username have to do with the database created by Search Service Application creation
and why can't I "Edit my profile" in My Profile?
     Thank you
     Shabeaut

Use Netmon to analyze the traffic and understand more on same
Check available DISK SPACE on SharePoint Servers and SQL Server. On SQL Instance especially check if any databases have set Size limits.
Did we modify something on EditProfile.aspx page. Any custom solution deployed related to search
or mysite
http://blogs.msmvps.com/brianmadsen/2011/12/06/sharepoint-2010-connectiontimeout-issues-from-wfe-to-profile-db/
add the SQL Server details into the hosts file on the WFE server.
http://social.technet.microsoft.com/Forums/sharepoint/en-US/7efeefce-129e-4a03-9ff7-900d6168952b/moss-event-id-3351-login-failed-for-user-nt-authorityanonymous-logon?forum=sharepointadminlegacy
 Running Windows sharepoint services vss writer service under AD farm account (instead of Local system) is the solution of my issue!
http://social.technet.microsoft.com/Forums/sharepoint/en-US/ca7d53d8-88e2-4a82-9978-8695a7074e5d/application-pool-identity-does-not-have-access-to-profiledb?forum=sharepointadminprevious
If this helped you resolve your issue, please mark it Answered

Similar Messages

  • Installed itunes 11 and now I get the following message 'The itunes library cannot be saved. An unknown error has occured (-50)

    Installed itunes 11 and now I get the following message 'The itunes library cannot be saved. An unknown error has occured (-50). How do I fix this problem?

    Same problem here since latest update.  As usual poor support from Apple with no answer or fix for this bug.

  • Just downloaded PDF Editor Pro, version 3.7.0, but it wasn't working. I checked for updates; none, but it showed "an error has occurred."  What do I do?

    Just downloaded PDF Editor Pro, version 3.7.0, but it wasn't working. I checked for updates; none, but it showed "an error has occurred."  What do I do?

    You should check the developer's website.

  • Login to Manage your Apple ID then An unknown error has occurred.

    For the last few days I've been receiving this error while trying to log into the management my apple ID at http://appleid.apple.com
    I can tell you that I can my appleid to successfully log into icloud, itunes, and this forum but receive this error above while trying to edit my profile. I do have 2 step authentication working and do have my Recover Key. I've used that to reset my password just in case.
    I did try to call apple support but they said they don't support browser issues. I told them I've tried on three different browsers and two diffrent computers.
    Steve

    Hi
    I have this too. I can log in to iCloud, iTunes and everywhere else.
    One thing I have done is that one one of my three iPhones, I have put a second Apple account on it so I can use the contacts from the first.
    I get the same error when logging into either of the two Apple IDs on the one iPhone. Note, I can log into friend's IDs without a problem.
    Did you get an answer to this?
    Tony

  • HT1414 when trying to update my iphone after the update it said i needed to restore my phone well when it gets to the end of the restore it wont finish it says unknown error has occured... what do i do?

    ?

    Hello Shrimplino
    The article below will assist with troubleshooting issues with restoring from back up.
    iOS: If you can't back up or restore from a backup in iTunes
    http://support.apple.com/kb/ts2529
    Regards,
    -Norm G.

  • Login failed for user 'IIS APPPOOL\DefaultAppPool' on SQL Express 2012

    I am new to both ASP.NET and SQL Server.
    I have IIS8 installed on my Windows 8 PC, together with SQL Server Express 2012. Given my ignorance, I have just set everything up using default values.
    I have a very small web site set up in its own folder and set up in IIS 8 as a virtual folder under the default web site. I have also set up a very simple database called 'StockControl' via SSMS, which contains one table called 'Colours' which has two columns.
    One page in the website is a simple ASP.NET form which runs on localhost without any problems.
    On the second page in the website I added a GridView ASP.NET control, letting Expression Web 4 generate the connection string and place it in a web.config file. I tested the SQL query and the connection as I went along and both came back as successful. So
    far, so good.However, when I try to run the page in the browser I get the error message:
    Server Error in '/' Application.
    Cannot open user default database. Login failed.
    Login failed for user 'IIS APPPOOL\DefaultAppPool'.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
    Login failed for user 'IIS APPPOOL\DefaultAppPool'.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    [SqlException (0x80131904): Cannot open user default database. Login failed.
    Login failed for user 'IIS APPPOOL\DefaultAppPool'.]
    I have spent two days trying to find out what I have done wrong and even uninstalled and re-installed SQL Server just in case i'd totally messed up and corrupted the database.
    I would really appreciate some help please.

    I changed the IIS default identity to NetworkService and got this error instead
    Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\StockControl.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
    An attempt to attach an auto-named database for file C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\StockControl.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
    There is nothing running that is using the database.
     I have also set a login up for the Apppool and set the user mapping to the database but the problem persists,
    What is so infuriating is that a week ago I had several pages in this website that displayed, inserted, updated and deleted records on this database using ADO as well as ASP.NET running just fine. Then this problem came out of nowhere.

  • I keep getting "The document could not be saved. A file I/O error has occurred."

    Everytime I try to save a PDF file in Reader X... "save as...PDF" I get the "The document could not be saved. A file I/O error has occurred."
    When I save it "save as...Text" is saves.

    No it is from a disk drive.
    Robb Hanke
    [signature deleted by host]

  • Non-SysAdmins get error 18456 Severity 14 State 11 Login Failed for user _ Reason Token-based server access validation failed with an infrastructure error.

    I have a SQL 2008 R2 system (10.50.4000) where I'm having problems connecting any user that is not a SysAdmin.  Example: I setup a new SQL Login to use Windows Authentication and grant that user db_datareader on the target database.  The user attempts
    to connect using Excel client or Access or SQL Management Studio and receives Error 18456.  The SQL Server Logs shows Error 18456 Severity 14 State 11 Login Failed for user _ Reason Token-based server access validation failed with an infrastructure error.
    The strange part is that if I temporarily grant the user the sysadmin server role then the user can connect successfully and retrieve data.  But, if I take away that sysadmin server role then the user can no longer connect but again receives the Error
    18456 Severity 14 State 11 Login Failed for user _ Reason Token-based server access validation failed with an infrastructure error.
    We've turned off UAC on the client machine to see if that was the problem, but no change.
    I have dropped and re-added the user's SQL Login (and the related database user login info).  No success.
    The Ring Buffers output shows:
    The Calling API Name: LookupAccountSidInternal
    API Name: LookupAccountSid
    Error Code: 0x534
    Thanks for any help.
    -Walt

    Yes, you understand correctly.  The user is logging onto a workstation (not the server) with a Windows Authenticated id.  The user is using either Excel or Access or SSMS and connecting to the server using a Windows Authenticated SQL Login account.
     If the account has sysadmin role (which is only for testing) then the connection is successful.  If I take away sysadmin role from the account then the connection is unsuccessful and the SQL Server Log shows Error
    18456 Severity 14 State 11 Login Failed for user _ Reason Token-based server access validation failed with an infrastructure error.
    (SQL Authentication is not an option here.  I must use Windows Authentication).
    Any other troubleshooting assistance you can offer would be appreciated.  Thanks.
    -Walt 

  • Server Error In '/' Application - Login failed for user xyz ...

    Hi, I'm brand new here 
    I would be ever grateful for help on this. It's probably something simple.
    I'm coding a website in C# ASP.NET (http://project.arcza.net). There is a registration page where you send your email, username all that stuff to an SQL server. The SQL server runs on my IIS server too. On Visual Studio, I can debug the website (i.e. launch
    it on localhost:12345) and I get a fully working website that I can register as a user and it injects into the SQL server's table. If I query the SQL server, I see the results. So it works fine here.
    The problem: if I copy the files for the website into the live IIS directory (as opposed from the Visual Studio preview environment) I get a runtime error thing, I have no idea what this means. The live IIS folder is project.arcza.net and I have disabled
    security so you can see the full workings of the probem.
    It says login failed for user 'pap'. Pap is a user I have added in SQL server, with username pap and password pap. The credentials are correct. I have added a 'connection string' (I have very little idea what this is) with thees credentials for an SQL server
    @ localhost, in IIS manager.
    Thank you and if you have any idea I'd be very happy.
    I should also point out that if I edit properties of pap in SQL server's login thing where it lists the accounts, I cannot save the settings (you know the ones where you give it permissions to access, delete, etc?) I can tick them and click okay but if I
    reoped properties and click on (I think off the top of my head it's called 'securities' but I may be wrong, it's 2nd from the bottom of the pane on the left) I see the tickboxes remain unticked. Could this have something to do with the "login failed for
    'pap'" message I'm seeing?

    Have a look at
    Errorlog. you should get reason of login failed for user.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Login failed for user 'MgmtSvc-AdminAPI' because the account is currently locked out.

    We are getting the following error on our SMA web service machine in the mgmtsvc-adminapi log file.   Im guessing I could have also posted this in the WAP forum.     Any ideas on what would cause this?
    Also, we noticed the connection strings in the adminapi site are encrypted as well so not sure what the credentials are that WAP adminapi is using.
    System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'MgmtSvc-AdminAPI' because the account is currently locked out. The system administrator can unlock it.
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
    Thanks Lance

    Just had this error happen again.   THis is the account that microsoft configured during the WAP portal install.   The connection strings in the web.config for the adminapi site is encrypted so you cant see the credentials.  
    The WAP install didnt create local computer user but does create SQL Auth user with the name of MgmtSvc-AdminAPI
    Log Name:      Microsoft-WindowsAzurePack-MgmtSvc-AdminAPI/Operational
    Source:        Microsoft-WindowsAzurePack-MgmtSvc-AdminAPI
    Date:          12/9/2014 5:07:54 PM
    Event ID:      12
    Task Category: (65522)
    Level:         Error
    Keywords:      None
    User:          IIS APPPOOL\MgmtSvc-AdminAPI
    Computer:      SMAWAPCOMPUTER
    Description:
    Error:
    System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'MgmtSvc-AdminAPI' because the account is currently locked out. The system administrator can unlock it.
       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.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
       at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
       at System.Data.SqlClient.SqlConnection.Open()
       at Microsoft.WindowsAzure.Server.Common.SessionManager.<IsMasterAsyncInternal>d__4.MoveNext()
       at Microsoft.WindowsAzure.Management.TaskSequencer.<>c__DisplayClass1e`1.<RunSequenceAsync>b__1d(Task previousTask)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Server.AdminManagement.Service.CleanupRunner.MaintenanceCycleRunner.<RunCycleAsync>d__0.MoveNext()
    ClientConnectionId:13052455-e404-404b-abf9-ad4a10f270fd, operationName:, version:, accept language:, subscription Id:, client request Id:, principal Id:, page request Id:, server request id:
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-WindowsAzurePack-MgmtSvc-AdminAPI" Guid="{93AB61E1-C729-402F-9569-A23FB5E0B2D6}" />
        <EventID>12</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>65522</Task>
        <Opcode>0</Opcode>
        <Keywords>0x0</Keywords>
        <TimeCreated SystemTime="2014-12-09T23:07:54.084193000Z" />
        <EventRecordID>599</EventRecordID>
        <Correlation />
        <Execution ProcessID="5316" ThreadID="8120" />
        <Channel>Microsoft-WindowsAzurePack-MgmtSvc-AdminAPI/Operational</Channel>
        <Computer>SMAWAPCOMPUTER</Computer>
        <Security UserID="S-1-5-82-1634760204-2030663537-3042087576-1698961595-280283016" />
      </System>
      <EventData>
        <Data Name="message">
    System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'MgmtSvc-AdminAPI' because the account is currently locked out. The system administrator can unlock it.
       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&amp; 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&amp; connection)
       at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection)
       at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&amp; connection)
       at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(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 Microsoft.WindowsAzure.Server.Common.SessionManager.&lt;IsMasterAsyncInternal&gt;d__4.MoveNext()
       at Microsoft.WindowsAzure.Management.TaskSequencer.&lt;&gt;c__DisplayClass1e`1.&lt;RunSequenceAsync&gt;b__1d(Task previousTask)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Server.AdminManagement.Service.CleanupRunner.MaintenanceCycleRunner.&lt;RunCycleAsync&gt;d__0.MoveNext()
    ClientConnectionId:13052455-e404-404b-abf9-ad4a10f270fd</Data>
        <Data Name="requestId">
        </Data>
        <Data Name="subscriptionId">
        </Data>
        <Data Name="clientRequestId">
        </Data>
        <Data Name="principalId">
        </Data>
        <Data Name="version">
        </Data>
        <Data Name="pageRequestId">
        </Data>
        <Data Name="acceptLanguage">
        </Data>
        <Data Name="operationName">
        </Data>
      </EventData>
    </Event>
    Thanks Lance

  • Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection

    "[DBNETLIB] Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection"
    After patches applied on patch Tuesday the database reports the above error. 
    All accounts are domain accounts and SQLServer uses Windows auth.
    DCDIAG show no errors
    All servers and DC have been restarted,
    Message in db log confirms the connection is being denied due to trust.
    Event log shows same rejection
    Protocols enabled: named pipes, tcpip, memory
    TESTS:
    PortQry: "
    TCP port 1433 (ms-sql-s service): LISTENING"
    Connect with domain admin accounts works from multiple clients systems to DB.
    Cannot connect with newly created domain admin account
    Can connect if new admin account connect to server in terminal server session and uses UDL wizard or any other tool including isql.
    New standard user also fails to connect.
    NOTES:
    I removed the SSL patch and the IE security update to see if that was an issue.
    ¯\_(ツ)_/¯

    Has someone left the company or has an account of some nature been dropped/replaced?
    Please click "Mark As Answer" if my post helped. Tony C.
    Hi Tony,
    Srry but No.  We just installed the monthly updates.
    I went back and found I had missed removing a patch.  I missed the rollup for Windows Server 2003:
    Event Type: Information
    Event Source: NtServicePack
    Event Category: None
    Event ID: 4382
    Date:  3/12/2015
    Time:  12:26:04 PM
    User:  NETTEST\admin
    Computer: DATA1
    Description:
    Windows Server 2003 KB954920 was removed from your computer, and the previous Windows Server 2003 configuration was restored.
    After I removed that is still didn't work but after about five minutes it started working.
    I guess I ned to report that to MS after I research what might be changed to make the patch work.
    Every time I get stuck and ask for help it seems to be just before I stumble on the solution.
    Thanks for replying.
    Well - maybe this will help someone else.
    Thanks again for replying Tony
    ¯\_(ツ)_/¯

  • Cannot open database "ReportServer" requested by the login. The login failed. Login failed for user 'USER LOGON'

    I want to grant permissions to all domain users to view reports on our Report Server. Domain users are able to access our Report Server URL and folder, but when they click on a report item they get an error message: 
    "Cannot open database "ReportServer" requested by the login. The login failed. Login failed for user 'USER LOGON'"
    I'm using windows authentication and configured the local service account in SSReportS Config Manager as the credentials to connect to the Report Server DB. 
    Can someone please help how I should properly do this step by step to give all domain users permissions to view a report in SSRS?
    Thanks much! - Rookie DBA

    Hi IWAR,
    The error message "Cannot open database "ReportServer" requested by the login. The login failed. Login failed for user 'USER LOGON'" means the user 'USER LOGON' does not have permissions to access the "ReportServer" database.
    To fix this issue, please verify that the user has a valid database user login. For more details, please refer to the following steps.
    In SQL Server Management Studio, open Object Explorer and expand the Databases folder.
    Expand the database in which to create the new database user.
    Right-click the Security folder, point to New, and then click User.
    On the General page, enter a name for the new user in the User name box.
    In the Login name box, enter the name of a SQL Server login to map to the database user.
    Click OK.
    Reference:
    http://technet.microsoft.com/en-us/library/ms156468(v=sql.105).aspx
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Sql Server 2012 Login Failed for user "NT Authority\System"

    I have installed SQL Server on a new server. I have been getting the following error on each of the database in it.
    Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database 'ABC'. [CLIENT: xxx.xxx.xxx.xxx]
    Here is some information on the instance:
    1) Default instance
    2) SQL Server, Sql Server Agent, Sql Server Reporting services are running / log on using a domain service account.
    3) Sql Server Browser is disabled.
    4) SQL Server VSS Writer is running / log on as Local Service.
    5) NT AUTHORITY\SYSTEM does exists in Login with just public server roles.
    I ran a trace on login failed and I get:
    ApplicationName: Microsoft Windows Script Host
    and it runs every 15 minutes.
    Help please?

    Hi,
    The error was thrown when the SCOM components connected to the backend SCOM databases.
     You can specify a domain account, grant it the sysadmin role and the error should be gone.
    Also, see the replies in your previous thread:
    http://social.technet.microsoft.com/Forums/en-US/23f6b6cb-ec41-4117-8613-26d24c948827/login-failed-for-user-username-reason-failed-to-open-the-explicitly-specified-database
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Unhandled Exception Error - Login Failed for User

    Hello,
    I am receiving an error when I run my application stating “Unhandled exception has occurred. If you click continue, the application will ignore the error………..Login failed for MyUser.
    When I click the Continue button the application runs and seems to work properly. This application used to run without receiving the error and I did not make any changes. I have another application that is using basically the exact same code and does not
    receive the error. The only difference is the application is querying a different DB but using the exact same connection string. The error only occurs when I run the exe file created from the build. When I run (debug) the application from within the VS 2013
    IDE I do not receive the error.
    Here are the details to the error message:
    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.
    ************** Exception Text **************
    System.Data.OleDb.OleDbException (0x80040E4D): Login failed for user 'jobrunner'.
       at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
       at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
       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.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.OleDb.OleDbConnection.Open()
       at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
       at LoanOrig_FDIC_Codes.DataSet1TableAdapters.I_LoansTableAdapter.Fill(I_LoansDataTable dataTable) in u:\Visual Studio Projects\LoanOrig_FDIC_Codes\LoanOrig_FDIC_Codes\LoanOrig_FDIC_Codes\DataSet1.Designer.cs:line 1668
       at LoanOrig_FDIC_Codes.Form1.Form1_Load_1(Object sender, EventArgs e) in u:\Visual Studio Projects\LoanOrig_FDIC_Codes\LoanOrig_FDIC_Codes\LoanOrig_FDIC_Codes\Form1.cs:line 152
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    ************** 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
    LoanOrig_FDIC_Codes
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///U:/Visual%20Studio%20Projects/LoanOrig_FDIC_Codes/LoanOrig_FDIC_Codes/LoanOrig_FDIC_Codes/bin/Debug/LoanOrig_FDIC_Codes.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.34238 built by: FX452RTMGDR
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.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.34234 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.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.Data.DataSetExtensions
        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.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
    System.Numerics
        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.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.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
    ************** 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.
    For example:
    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>
    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
    I'm not sure what the JIT debugger is but to my knowledge my other apps are not using that. The production username and password are correct in the connection string so I'm not clear why I am receiving this error especially since I'm not receiving the
    error on my other application. I have also attached the code just in case it is needed. Any assistance will be greatly appreciated. Thank you.
    Dave
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using ClosedXML.Excel;
    using DocumentFormat.OpenXml;
    using System.IO;
    namespace LoanOrig_FDIC_Codes
    public partial class Form1 : Form
    SqlCommand sqlCmd;
    SqlDataAdapter sqlDA;
    DataSet sqlDS;
    DataTable sqlDT;
    SqlCommand sqlCmdCnt;
    public Form1()
    InitializeComponent();
    //BEGIN BUTTON LOAD CLICK EVENT
    private void btnLoad_Click(object sender, EventArgs e)
    string sqlCon = "Data Source=FS-12345; Initial Catalog=ExtractGenerator; User ID=MyUser; Password=MyPW";
    //Set the 2 dateTimePickers to today's date
    DateTime @endDate = End_dateTimePicker.Value.Date;
    DateTime @startDate = Start_dateTimePicker.Value.Date;
    //Validate the values of the 2 dateTimePickers
    if (endDate < startDate)
    MessageBox.Show("End Date must be greater than or equal to the Start Date OR Start Date must be less than or equal to the End Date ", "Incorrect Date Selection",MessageBoxButtons.OK,MessageBoxIcon.Error);
    //Reset both dateTimePickers to todays date
    Start_dateTimePicker.Value = DateTime.Today;
    End_dateTimePicker.Value = DateTime.Today;
    return;
    //End of date validation
    string sqlData = @"SELECT AcctNbr,
    CurrAcctStatCD,
    Org,
    MJAcctTypCD,
    MIAcctTypCD,
    NoteOriginalBalance,
    ContractDate,
    FDICCATCD,
    FDICCATDESC,
    PropType,
    PropTypeDesc
    FROM I_Loans
    WHERE CAST(ContractDate AS datetime) BETWEEN @startdate AND @enddate ORDER BY ContractDate";
    SqlConnection connection = new SqlConnection(sqlCon);
    SqlCommand sqlCmd = new SqlCommand(sqlData, connection);
    sqlCmd.Parameters.AddWithValue("@startDate", startDate);
    sqlCmd.Parameters.AddWithValue("@endDate", endDate);
    sqlDS = new DataSet();
    sqlDA = new SqlDataAdapter(sqlCmd); //SqlAdapter acts as a bridge between the DataSet and SQL Server for retrieving the data
    connection.Open();
    sqlDA.SelectCommand = sqlCmd; //SqlAdapter uses the SelectCommand property to get the SQL statement used to retrieve the records from the table
    sqlDA.Fill(sqlDS, "I_Loans"); //SqlAdapter uses the "Fill" method so that the DataSet will match the data in the SQL table
    sqlDT = sqlDS.Tables["I_Loans"];
    //Code section to get record count
    sqlCmdCnt = connection.CreateCommand();
    sqlCmdCnt.CommandText = "SELECT COUNT(AcctNbr) AS myCnt FROM I_Loans WHERE ContractDate BETWEEN @startDate AND @endDate";
    sqlCmdCnt.Parameters.AddWithValue("@startDate", startDate);
    sqlCmdCnt.Parameters.AddWithValue("@endDate", endDate);
    int recCnt = (int)sqlCmdCnt.ExecuteScalar();
    txtRecCnt.Text = recCnt.ToString();
    btnExport.Enabled = true;
    //End of code section for record count
    connection.Close();
    dataGridView1.DataSource = sqlDS.Tables["I_Loans"];
    dataGridView1.ReadOnly = true;
    //Reset both dateTimePickers to todays date
    Start_dateTimePicker.Value = DateTime.Today;
    End_dateTimePicker.Value = DateTime.Today;
    //END BUTTON LOAD CLICK EVENT
    //BEGIN BUTTON EXPORT CLICK EVENT
    private void btnExport_Click(object sender, EventArgs e)
    SaveFileDialog saveFD = new SaveFileDialog();
    { //ClosedXML code to export datagrid result set to Excel
    string dirInfo = Path.GetPathRoot(@"\\FS-03250\users\dyoung\LoanOrig_FDIC_Codes");
    if (Directory.Exists(dirInfo))
    var wb = new XLWorkbook();
    var ws = wb.Worksheets.Add(sqlDT);
    ws.Tables.First().ShowAutoFilter = false;
    //SaveFileDialog saveFD = new SaveFileDialog(); //I moved this variable to the top of the btnExport code block so that the variable will be available thru the entire scope of that code block
    saveFD.Title = "Save As";
    saveFD.Filter = "Excel File (*.xlsx)| *.xlsx";
    saveFD.FileName = "LoanOrig_FDIC_Codes_" + DateTime.Now.ToString("yyyy-MM-dd");
    if (saveFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    Stream stream = saveFD.OpenFile();
    wb.SaveAs(stream);
    stream.Close();
    else if (saveFD.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
    MessageBox.Show("Save file operation has been canceled", "Save As Canceled", MessageBoxButtons.OK, MessageBoxIcon.Stop);
    return;
    //End of ClosedXML code
    MessageBox.Show("File has been exported to " + saveFD.FileName, "File Exported", MessageBoxButtons.OK, MessageBoxIcon.Information);
    //MessageBox.Show("File has been exported to U:\\LoanOrig_FDIC_Codes", "File Exported", MessageBoxButtons.OK, MessageBoxIcon.Information);
    else
    MessageBox.Show("Drive " + saveFD.FileName + " " + "not found, not accessible, or you may have invalid permissions");
    //MessageBox.Show("Drive " + "U:\\Visual Studio Projects\\LoanOrig_FDIC_Codes" + " " + "not found, not accessible, or you may have invalid permissions");
    return;
    //END THE SAVE AS PROCESS
    //END BUTTON EXPORT CLICK EVENT
    private void Form1_Load(object sender, EventArgs e)
    //Set dates to be today's date when the form is openend
    Start_dateTimePicker.Value = DateTime.Today;
    End_dateTimePicker.Value = DateTime.Today;
    private void Form1_Load_1(object sender, EventArgs e)
    // TODO: This line of code loads data into the 'dataSet1.I_Loans' table. You can move, or remove it, as needed.
    this.i_LoansTableAdapter.Fill(this.dataSet1.I_Loans);
    private void iLoansBindingSource_CurrentChanged(object sender, EventArgs e)
    private void btnExit_Click(object sender, EventArgs e)
    this.Close();
    David Young

    In SQL you have a login which allows access to the server but you must also have permissions to access each database that you will use (including Master). So I would verify that your user also has the necessary permissions on the database itself and
    not just the SQL instance. The error you're getting is from SQL saying that the user doesn't have permissions.  If it works for 1 DB but not the other on the same SQL instance then it is likely a missing permission on the DB itself.
    I should note that you have a hard coded conn string in your code but the error is for a different user.  I'm assuming that you simply posted it there for convenience and that you changed the values to obscure the data.  If you are actually getting
    the info from your config file then verify the connection string is correct. Also be sure to not use Integrated Security since it appears that you are using SQL authentication.

  • Login failed for user 'NT AUTHORITY\ANONYMOUS

    Hi All
    I have already gone thru lot of links, So appreciate if i can have some solution
    I have 3 servers A, B and C . A and B are in same domain and C is in different domain. and I am sysadmin in all 3 servers and all have trusted connection with each other
    1. All have tcp and named pipe enable
    2. All 3 servers and all services including browser are up and running
    3. When i connect any sql server from any Server using SSMS i am able to connect and  (net_transport, auth_scheme = TCP , NTLM).
    Now i create linked server at server B to Server C (C domain is different than A and B).  When i login on Server B and try to run query on C its working fine. But after remote login to server A and connect sql server at B using SSMS when
    i expand linked server to c i cant see databases and query is giving error "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'"
    I also tried to connect to all 3 server in ssms using forced  named pipes but i am getting below error
    "provider named pipes provider error 40 - Could not open connection to sql server"
    My question :
    1. I have to use domain account to use linked server from server A to connect SQLserver B to server C, How this can be done is this related to Double hop ??
    2. Why i cant connect using forced Named pipe to any server using SSMS except local host
    Thanks Saurabh Sinha http://saurabhsinhainblogs.blogspot.in/ Please click the Mark as answer button and vote as helpful if this reply solves your problem

    Hello,
    First, it is possible to use Kerberos delegation across trusted domains.
    net_transport, auth_scheme = TCP , NTLM
    This means something isn't correctly setup as you're defaulting back to NTLM. This should read Kerberos if your SPNs were setup correctly and authenticated properly. Check the SPNs and service accounts.
    http://technet.microsoft.com/en-us/library/cc280744(v=SQL.105).aspx
    1. I have to use domain account to use linked server from server A to connect SQLserver B to server C, How this can be done is this related to Double hop ??
    To go across domains I'm not entirely sure on that part, but I can say it'd probably be easier if you did use a domain account as the service account.
    2. Why i cant connect using forced Named pipe to any server using SSMS except local host
    I'm not quite sure what you mean here. You can't connect through NP? Why the need for NP at all?
    Sean Gallardy | Blog |
    Twitter

Maybe you are looking for

  • Error while creating Function.

    Hii All, I'm currently working on 10gR2 .I'm trying to dynamically pass a column and parse it but I've encountered following error.Please help me. Create or replace Function r_return_col                      p_table_name          in          varchar2

  • Which of these two raid cards will work better?

    Which of these cards would be better suited for video editing: Areca ARC-1882i LSI 9265-8i Both are approximately the same price and just in my price range.  I will have four 1TB HDD's that I want to put in a raid array.  Also assume either one will

  • Ipod 4th Gen Nano wont sync with Itunes

    Win 7 Ipod 4th Gen Nano Just downloaded newest Itunes I have a few hundred tunes on my IPod. I recently puchased a song In Itunes store. I attached Ipod to laptop ..clicked on Itunes..saw the song in my library byt it wont sync it to the Ipod. Any id

  • Lightroom 5.4 crashes when trying to sync photos with IPad

    Need help with lightroom 5.4 I was trying to syc my photos to my IPad and the program stopped working. How do I cancel my syc before the program crashes. I have tried to sigh out but the program crashes before I'm able to do any thing. The program cr

  • List of webinars/Videos to showcase Captivate in less than 1 hour.

    Hello, we would like to showcase Captivate to our entire company. We will have a meeting with about 10-15 people from different departments. Such people are not familiar with the product. Would you have a list of links short videos/webinars that you