I have a web project which I want to post in to our company`s hosting server: IIS Vs.6.0. The name of the server which is running our whole websites is: testing.test.com and domain is testing.com I am added as a User in it as myname@testing.com.
Now in the IIS Manager in the server there is a folder called websites and I made a folder called 'test'. Published my project into that folder. But here is the catch:
I am logging in my PC as another domain and the server is in another domain. When I see the permissions of this folder it says:
myname@testing.com
However, I am accessing this webpage as: myname@anotherdomain.com. This err I am getting when accessing the page:
Server Error in '/' Application.
Login failed for user 'testing\test'. 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.SqlClient.SqlException: Login failed for user 'testing\test'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Login failed for user 'testing\test'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009598
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlConnection.Open() +125
System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) +43
System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() +47
System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() +20
System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +57
System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +34
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +315
System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
System.Data.Linq.Provider.BindingList.Create(DataContext context, IEnumerable`1 sequence) +82
System.Data.Linq.DataQuery`1.GetNewBindingList() +40
System.Data.Linq.DataQuery`1.System.ComponentModel.IListSource.GetList() +15
System.Web.UI.DataSourceHelper.GetResolvedDataSource(Object dataSource, String dataMember) +54
System.Web.UI.WebControls.ReadOnlyDataSource.System.Web.UI.IDataSource.GetView(String viewName) +41
System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +266
System.Web.UI.WebControls.DataBoundControl.GetData() +4
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +59
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
System.Web.UI.WebControls.GridView.DataBind() +4
EntityRegistration.FrontEnd.AgentList.Page_Load(Object sender, EventArgs e) in C:\Users\raj.OIS\Desktop\Dropbox\OIS Entity\EntityRegistration\EntityRegistration\FrontEnd\AgentList.aspx.cs:35
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
What is wrong here?
It is unclear where your database is residing here, I'm going to presume on the web server.
The issue is your Sql configuration is using the default windows integrated authentication method running in the context of your web app (E-SOFTIND\MAGNUS$) and said user isn't setup on the SQL instance on your database server so the credentials are getting rejected.
Very easy to fix, typical options include:
E-SOFTIND\MAGNUS$
user to the sql instance, give it appropriate permissions (GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE ON SCHEMA::dbo
is a good 1st guess if you have no idea).But, basically, you need to identify a user and give it appropriate permissions in your database.
It sounds like you are using integrated security for your SQL Server connection string. If that is the case, you will need to add the Network Service or E-SOFTIND\$MAGNUS login to the SQL Server in question. That new login should be a Windows user and mapped to the database in question with appropriate rights to read/write/delete/etc. as needed in the database.
If SQL Server is installed on the same computer as the web server, use the local Network Service account. If it is on a different computer within the same domain, use E-SOFTIND\$MAGNUS as the Windows user (this is a map to the Network Service account on the MAGNUS computer, on the E-SOFTIND domain).
Note the user name is the domain, a back-slash ("\"), the dollar sign ("$"), then the name of the computer the web server is installed to.
User contributions licensed under CC BY-SA 3.0