?
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
Medium Priority
?
198 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 18

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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 37

Accepted Solution

by:
Neil Russell earned 2000 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

770 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