ka8799
asked on
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?
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\mssqlser ver12;User ID=corp\PA 430002;Pas sword=base 4ball3;Dat abase=FFKM aster;Trus ted_Connec tion=True; Integrated Security=SSPI;Provider=SQL OLEDB.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.OleDbExc eption: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
Source Error:
Line 31: dbconn = New OleDbConnection(globalvari ables.conn str)
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\ProdCus t\WebSite6 \login.asp x.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.OleDbCon nectionInt ernal..cto r(OleDbCon nectionStr ing constr, OleDbConnection connection) +351
System.Data.OleDb.OleDbCon nectionFac tory.Creat eConnectio n(DbConnec tionOption s options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +86
System.Data.ProviderBase.D bConnectio nFactory.C reateNonPo oledConnec tion(DbCon nection owningConnection, DbConnectionPoolGroup poolGroup) +31
System.Data.ProviderBase.D bConnectio nFactory.G etConnecti on(DbConne ction owningConnection) +76
System.Data.ProviderBase.D bConnectio nClosed.Op enConnecti on(DbConne ction outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.OleDb.OleDbCon nection.Op en() +43
login.loginvalidation(Stri ng UserName, String Password) in E:\Inetpub\wwwroot\ProdCus t\WebSite6 \login.asp x.vb:33
login.Login1_Authenticate1 (Object sender, AuthenticateEventArgs e) in E:\Inetpub\wwwroot\ProdCus t\WebSite6 \login.asp x.vb:83
System.Web.UI.WebControls. Login.OnAu thenticate (Authentic ateEventAr gs e) +115
System.Web.UI.WebControls. Login.Atte mptLogin() +127
System.Web.UI.WebControls. Login.OnBu bbleEvent( Object source, EventArgs e) +101
System.Web.UI.Control.Rais eBubbleEve nt(Object source, EventArgs args) +37
System.Web.UI.WebControls. Button.OnC ommand(Com mandEventA rgs e) +125
System.Web.UI.WebControls. Button.Rai sePostBack Event(Stri ng eventArgument) +167
System.Web.UI.WebControls. Button.Sys tem.Web.UI .IPostBack EventHandl er.RaisePo stBackEven t(String eventArgument) +10
System.Web.UI.Page.RaisePo stBackEven t(IPostBac kEventHand ler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePo stBackEven t(NameValu eCollectio n postData) +36
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +5563
__________________________ __________ ____
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1022
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\mssqlser
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.OleDbExc
Source Error:
Line 31: dbconn = New OleDbConnection(globalvari
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\ProdCus
Stack Trace:
[OleDbException (0x80004005): Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.]
System.Data.OleDb.OleDbCon
System.Data.OleDb.OleDbCon
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.OleDb.OleDbCon
login.loginvalidation(Stri
login.Login1_Authenticate1
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Control.Rais
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Page.RaisePo
System.Web.UI.Page.RaisePo
System.Web.UI.Page.Process
__________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1022
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
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
ASKER
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\mssqlser ver12;User ID=cassyin put;Passwo rd=status1 ;Database= FFKMaster; Trusted_Co nnection=T rue;Integr ated Security=SSPI;Provider=SQL OLEDB.1"
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\mssqlser
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much Neilsr... :) It is working fine now.
You are welcome.
ASKER
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?
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?
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?
ASKER
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).
Two seperate domains?
ASKER
yes
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.