Password is correct but still compain Login failed in C sharp

Hello,
I am developing a small tool to collect the performance data and save the data in a central database, as you can see the end servers could be in different domains, the weird thing is the tool is running successfully on our servers in two different domains,
when run it on the third domain(our new environment), it always complains the login failed error, I found it might be related to the Integrated Security setting in the connection string, if I change it to false, the tool cannot work on all environments, but
no matter what value I use(SSPI,TRUE,FALSE), it just failed in the new environment, I have tried to use the same login in ODBC/SMSS on this new environment, all working fine, the instance name, database name are correct, everything is correct in program, it
doesn't work on this new machine.
My environment is windows 2012 R2 .Net 4.5
Any ideas? Thanks a million!
Please see below details:
using (SqlConnection con = new SqlConnection(@"Data Source=servername;Initial Catalog=dbname;Integrated Security=false;UID=ReportUser;Password=12345678"))
Log File Viewer:
Login failed for user 'ReportUser'. Reason: Password did not match that for the login provided. [CLIENT: 10.61.132.101]
Error: 18456, Severity: 14, State: 8.
C Sharp exception:
[12-Dec-2014 15:16:23] Error Message:System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'ReportUser'.    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 System.Data.SqlClient.SqlBulkCopy.CreateOrValidateConnection(String
method)    at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken)    at System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table, DataRowState rowState)    at ClusterServerMonitor1._0.Program.Main(String[]
args) ClientConnectionId:5a9db108-fdb4-4164-b539-ae87fd9786c1
using (SqlConnection con = new SqlConnection(@"Data Source=servername;Initial Catalog=dbname;Integrated Security=SSPI;UID=ReportUser;Password=12345678"))
[16-Dec-2014 16:29:29] Error Message:System.Data.SqlClient.SqlException (0x80131904): Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
   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 ClusterServerMonitor1._0.Program.Main(String[] args)
ClientConnectionId:a7156d12-ec69-482e-83f6-cfdb30e5bc8d

There are two different errors from error log.
Login failed for user 'ReportUser'. Reason: Password did not match that for the login provided. [CLIENT: 10.61.132.101]
Error: 18456, Severity: 14, State: 8.
This error indicates that there is invalid password issue.
[16-Dec-2014 16:29:29] Error Message:System.Data.SqlClient.SqlException (0x80131904): Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
see below link:
http://stackoverflow.com/questions/14170927/login-failed-the-login-is-from-an-untrusted-domain-and-cannot-be-used-with-wind
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Thanks,
Shashikant

Similar Messages

  • My apple ID password works for all of my devices but one.  i only have one account and have changed the password several times but still cannot get it to work on my iPhone.  any suggestions would be appreciated.

    My apple ID password works for all of my devices but one.  i only have one account and have changed the password several times but still cannot get it to work on my iPhone.  any suggestions would be appreciated.

    Thanks for the suggestion, Chris.  I actually did not resolve the issue which is why i did not post an answer. 
    it turns out that my iphone seems to default to an incorrect User ID (it defaults to an @me account, which is not something that i have ever used). 
    even when i change the User ID in my settings for the iTunes store, it still appears when i attempt to get updates for my existing apps.  however, it does seem to use the correct ID when i attempt to purchase new apps.
    If someone actually had an answer to correct this, i would love to update my existing apps. 
    Thank you.

  • Ipad keeps requesting outlook password, trying cancel but still in cycle - can not do anything else.  NOTE - recently change email password on PC

    ipad keeps requesting outlook password, trying cancel but still in cycle - can not do anything else.  NOTE - recently change email password on PC

    Try a reboot:
    To reboot your iPad, hold down the sleep/wake button and the home button simultaneously until the screen goes black and the Apple logo appears. If, during this process, a slider appears on the screen to power it off, ignore it and keep holding the buttons down.
    Rebooting your iPad can solve a lot of problems. Once you do that, go into Settings > Mail, Contacts, Calendars and make sure the correct, new password is entered in that account.

  • I am trying to synch my ipad to my computer and i have turn off my Find my iPad function.  I have put in my Apple password to do that.  i know my password is correct but it says it is not correct.  How do I fix that?

    i am trying to synch my ipad to my computer and i have turn off my Find my iPad function.  I have put in my Apple password to do that.  i know my password is correct but it says it is not correct.  How do I fix that?

    And I am incorrect...
    Have you ever changed your passcode?
    Try again.   Maybe a typo?

  • I know my Apple ID and password is correct, but then I enter them to activate FaceTime it says one of them is wrong.  Can anyone help?

    I know my Apple ID and password is correct, but then I enter them to activate FaceTime it says one of them is wrong.  Can anyone help?

    iMessage and FaceTime are currently experiencing problems it's nothing that you are doing wrong. Just wait it out and check back for iCloud status. 
    http://www.apple.com/support/icloud/systemstatus/

  • I lost my connection when I was using internet and when I want to reconnect to airport it give me connection timeout error, I changed my password on router but still doesn't work. How can i fix my problem?

    Hi,
    I lost my airport connection when I was using internet and when I wanted to re-reconnect to airport it gave me connection timeout error, I changed my password on router but still doesn't work. How can i fix my problem?

    Hello there hastibahreini,
    It sounds like you were using your Wi-Fi network from your Airport base station and the connection cut out. You have reset the password on the device but the issue persists. I would try the 3 resets outlined in the following article in order to help resolve the issue. If it persists, is the Wi-Fi connection issue happening on more than one device or computer?
    Resetting an AirPort base station FAQ
    http://support.apple.com/kb/ht3728
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • TS1398 iPad won't recognize wifi password after 7.0.2 update.  (The password is correct, but iPad says it's incorrect) How do I fix this?

    My iPad won't recognize my wifi password after 7.0.2 update.  The password IS correct, but I continue to get the message that the password is incorrect.  Any ideas how to fix this?

    I have the same problem too on my iPad 3. One thing that sometimes works is if you go to the App Store and put your password in there after a few tries it may work.

  • Trying to publsh changes to my website. I get a message "There was an error communicating with the FTP server. Try again later, or check with your service provider." I did, and all my settings are correct, but still cannot publish

    Trying to publsh changes to my website. I get a message "There was an error communicating with the FTP server. Try again later, or check with your service provider." I did, and all my settings are correct, but still cannot publish.
    Any other ideas?

    Most likely you are suffering from a bug in iWeb that doesn't let you publish websites if an image you have added to your site begins with space. You can either search for that image and remove it.
    <Link Edited by Host>

  • Why isn't my wifi connecting over a secure network? I typed the password in correctly, but it won't seem to connect.

    Why isn't my wifi connecting over a secure network? I typed the password in correctly, but it won't seem to connect.

    Tap Settings / Wi-Fi. Tap the blue circle with an arrow to the right of your network then tap: Forget This Network.
    Restart the iPad. Tap Settings / Wi-Fi. Tap the network name again then type in your password.
    If that didn't help, try here >  Apple - Support - iPad - Wi-Fi Assistant
    And try turning off your router for 5 minutes, then turn it back on. Try typing in the password again.

  • I cannot install adobe flash onto my mac, whenever the installation box appears it asks for a password! I have entered my apple ID password and any other password I use, but still no joy! Any advice?

    I cannot install adobe flash onto my mac, whenever the installation box appears it asks for a password! I have entered my apple ID password and any other password I use, but still no joy! Any advice?

    Exactly where are you getting your Flash from? It is quite free from the maker, no password needed.
    http://get.adobe.com/flashplayer/
    However, if you fell for a trap and were lured into a fake site to rob you of your Apple ID credentials, I suggest you change your passwords immediately.

  • The saved password is correct but the site doesn't accept it. I still have to type it each time. how to fix this?

    The password saved for a site is correct but the site still doesnot accept it and I have to type it in each time. How do I fix this?
    == This happened ==
    Not sure how often
    == always

    "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    See http://kb.mozillazine.org/Clearing_the_cache and http://kb.mozillazine.org/Cookies
    Check that you have only saved one name and password from that web server.
    See: Tools > Page Info > Security
    You can check that site here: Tools > Options > Security: Passwords: "Saved Passwords" > "Show Passwords"

  • Reports successfully execute but generate a login failed for user 'sa' err

    I am running Crystal Reports Server XI R2. Classic ASP is used to generate embedded reports within our application. The crystal reports use ODBC to connect to a SQL Server 2005 database. The reports successfully generate in our Classic ASP application. However in SQL Server 2005,  the following error messages are being generated each time a crystal report is ran:
    - Login failed for user 'sa'.
    - Error: 18456, Severity: 14, State: 8.
    We know that we are passing the correct username/password to the crystal reports, becuase they execute successfully.
    It appears that when the report is called, Crystal Reports appears to conect to SQL Server using a username/password that we didn't provide it at execution time, this fails and the SQL Server 'login failed for user' is generated. Then it runs the report using the username/password we provide and it successfully generates a report.
    I have ran Profiler against the SQL Server Database and the 'Login failed for user 'sa' ' errors have a ApplicationName of either 'Seagate Crystal Reports' or 'Crystal Reports'. Therefore I know it is Crystal Reports generating these errors in SQL Server.
    Does anyone have any ideas on how to stop these SQL Server 'Login failed for user 'sa' ' errors being generated?

    What happens if you use Profiler when running the report using Crystal Report Designer?
    If the report is ran through Crystal Report Designer, NO 'Login failed for user' error messages appear in profiler. Everything looks ok when ran in Designer.
    Also, need to know what patch level you are on?
    We are running Crystal Reports Server XI Release 2, Version: 11.5.8.8265
    No additional patchs have been applied since Crystal Reports Server was installed.
    We may try the SA account if one of the connections fail to log on with the credentials you provided. Verify the user you logged on with has rights to all tables.
    The reports were running through our application using the SA account. The SA account has permissions to these tables. The reports do generate results and appear perfectly fine in the application.  The issue is that when our application requests the report from Crystal Reports Server. Crystal Reports Server delivers the correct report to our application. However during the process to generate the report, 'login failed for user 'sa' ' errors are being generated in SQL Server 2005.
    Also, I have tried creating a completely new SQL user called 'crystaluser'. I ran the report using Crystal Report Designer and used the crystaluser logon and saved the report. Then I ran the same report through our application. SQL Profiler will then display 'login failed for user 'crystaluser''. 
    Its seems as though Crystal Reports Server is first executing the report using the default SQL user saved with the report, but is either sending a blank password or no password at all. This generates the 'login failed for user' in SQL Server 2005. But it then uses the SQL username/password my application gives it and successfully generates the report. Of course this is only speculation.

  • Hi I got iPhone 4 been getting apps today went to get an app and won't let me even free ones have to sign in then sign in again for billing info it's all correct but still won't download apps had problem before fixed it but won't work again

    iPhone has previously downloaded apps but go to do today and won't keeps asking for billing info which is in there and correct but then says plz update you payment there is a billing problem with your previous purchase it's done before to me so reset and erased everything and worked did that Again and still doesn't work  info is all correct have to re enter Ccv number still doesn't work driving me nuts I want my apps

    If you had money in your account when you purchased a paid app and Apple didn't claim on the payment to your bank until after the download it maybe that there was insufficient balancce in your account to complete the purchase and therefore you'll need to wait until you have the funds to make the payment, when you have billing issues it won't even let you download free apps.
    If that isn't the case then give iTunes store a call or email them and they can tell you exactly what is wrong with the account

  • My apple id password is correct but my computer won't accept it

    just updated to mountain lion and now my computer can't connect to icloud
    i know my password is correct because it is working on my phone and for itunes, but my computer won't take it

    Also, it's not offering any assistance (i.e. "click here for help") so I'm just stuck

  • TS2446 i mistakenly entered the wrong password several times thus prompted "the apple id is disabled" , now i reset my password three times but still it is disabled. help pls!

    pls help, my apple id was disabled because i entered the wrong password several times . i did what the apple site said and reset my password. i did it three time but still my apple id is disabled. does anyone know how i can fix this... pls help

    Connect the device to your iTunes library in recovery mode and restore it.  See this article for instrutions on getting your iPod into recovery mode.
    iOS: Unable to update or restore
    B-rock

Maybe you are looking for

  • Encore doesn't "see" blank media in DVD burner

    When I try and burn a project to a DVD I get the message;" Please insert media". I've tried several different blank discs, as well as different brands...no matter what I still get this message. I can play pre-recorded DVDs in the burner, as well as m

  • Resizing using actual measurements in inches. I want to resize an 8 x 10 to an 11 x 14.

    I need to resize my photos so I can upload them to a printing service such as walgreen's so that I can pick them up the same day. I want to resize from 8 x 10 to 11 x 14.  I enter 11 in the width and when I enter the height the width changes to some

  • Installation d'adobe master collection cs6

    Bonjour à tous, je tente d'installer sur mon pc adobe cs6 en remplacement de cs5.5, mais il y a le message suivant."le programme d'installation n'a pas pu s'initialiser.Télécharger le adobe support Advisor pour detecter les problèmes. j'ai pu faire c

  • No IP Printer option in Printer Setup Utility

    Hey- Trying to add a print server and instructions say I need to add it as an IP printer. I go into: - printer and fax settings - add printer and there is no IP printer option. There is HP IP printing and epson TCP/IP but no IP printer option. I have

  • Adding a new category

    Hi All, I want to attach a PDF file to the delivery in teh shipping transactions form, when i click on the paperclip symbol a dialogue box opens where in i am able to see a seq, category etc etc. In teh category the default is "Short Text". I want to