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
190 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
  • 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

861 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