Solved

I created website and it is working fine while i running from visual studio but when i published in IIS, it shows error like below.  Could you pls help me to resolve this issue?

Posted on 2014-12-27
11
196 Views
Last Modified: 2015-01-09
Hi,

I created website and it is working fine while i running from visual studio but when i published in IIS, it shows error like below.

Could you pls help me to resolve this issue? String and error is like below.

Public Shared connstr As String = "Server=sgbdun302\mssqlserver12;UserID=corp\PA430002;Password=base4ball3;Database=FFKMaster;Trusted_Connection=True;Integrated Security=SSPI;Provider=SQLOLEDB.1"

Server Error in '/' Application.
________________________________________
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
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.OleDb.OleDbException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

Source Error:
 
Line 31:         dbconn = New OleDbConnection(globalvariables.connstr)
Line 32:         sqljunk = "SELECT * FROM tblcflusers"
Line 33:         dbconn.Open()
Line 34:         dbcomm = New OleDbCommand(sqljunk, dbconn)
Line 35:         dbread = dbcomm.ExecuteReader

Source File: E:\Inetpub\wwwroot\ProdCust\WebSite6\login.aspx.vb    Line: 33

Stack Trace:
 
[OleDbException (0x80004005): Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.]
   System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +351
   System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +86
   System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +31
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +76
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.OleDb.OleDbConnection.Open() +43
   login.loginvalidation(String UserName, String Password) in E:\Inetpub\wwwroot\ProdCust\WebSite6\login.aspx.vb:33
   login.Login1_Authenticate1(Object sender, AuthenticateEventArgs e) in E:\Inetpub\wwwroot\ProdCust\WebSite6\login.aspx.vb:83
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +115
   System.Web.UI.WebControls.Login.AttemptLogin() +127
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
 
________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1022
0
Comment
Question by:ka8799
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40519512
Firstly,  Trusted_Connection=True  AND  Integrated Security=SSPI are exactly the same thing. They are just different ways of typing the same command in effect.

Secondly, You try and specify a username and password, if you are using Trusted_Connection=True then those will be ignored completely.

To use trusted mode your web server AND SQL server MUST be on the same AD domain.
Otherwise you need to use SQL authentication.
0
 
LVL 17

Expert Comment

by:Emmanuel Adebayo
ID: 40519517
Can you check the connectivity to your ODBC connectivity to your Database from your IIS server?

Also, is your SQL server in the same domain as your IIS server?

As Neilsr suggested, you might need to use SQL authentication if your server and IIS are not in the same domain instead of intregrated authentication.


Regards
0
 

Author Comment

by:ka8799
ID: 40521507
Hi,

I tried with SQL authentication with the below string. But still the same issue exists. Could you please here to move further?
Is that connection string correct?

Public Shared connstr As String = "Server=sgbdun302\mssqlserver12;UserID=cassyinput;Password=status1;Database=FFKMaster;Trusted_Connection=True;Integrated Security=SSPI;Provider=SQLOLEDB.1"
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 37

Accepted Solution

by:
Neil Russell earned 500 total points
ID: 40521595
NO.  You still have Trusted_Connection=True;Integrated Security=SSPI;  and that tells it to use windows integrated auth.

You need only have....

Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;
Password=myPassword;
0
 

Author Comment

by:ka8799
ID: 40523394
Thank you so much Neilsr... :) It is working fine now.
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40523404
You are welcome.
0
 

Author Comment

by:ka8799
ID: 40527708
Hi,

Actually now it is working with SQL authentication. Do you have any idea to work the same code with windows authentication? Is that need to change the above string for windows authentication?
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40527867
Are ALL of the servers on the same domain as domain servers and you can log into windows on them both as a domain administrator?
0
 

Author Comment

by:ka8799
ID: 40533099
I can login into windows as domain administrator in one server and i have windows authentication access for SQL server in another server(In this server, i am not a domain administrator).
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40533103
Two seperate domains?
0
 

Author Comment

by:ka8799
ID: 40539759
yes
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question