I am getting the following error when I attempt to connect to SqlServer with the following connection string from my Web.config file:
<add name="LeanPathConnection" connectionString="Data Source=(local);Initial Catalog=VWOA1.DB;User Id=LeanPath;Password=jesus" />
I have made LeanPath a user at the Security level of the server. His default database is VWOA1.DB. I have given him db_owner rights. The following contains the exception detail I get. I don't see how he could NOT have a trusted SQL Server connection!!!!!!
System.Data.SqlClient.SqlException was unhandled by user code
Message="Login failed for user 'LeanPath'. The user is not associated with a trusted SQL Server connection."
Source=".Net SqlClient Data Provider"
ErrorCode=-2146232060
Class=14
LineNumber=65536
Number=18452
Procedure=""
Server="localhost"
State=1
StackTrace:
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at DbConnection.Open() in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\App_Code\DbConnection.cs:line 21
at MyBase.Execute() in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\App_Code\DbStoredProc.cs:line 63
at MyReturn.RetValParamInt(String ParamName) in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\App_Code\DbStoredProc.cs:line 328
at DbStoredProc.PER_Validate(String LoginName, String Password) in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\App_Code\DbStoredProc.cs:line 1215
at Login.btnLogin_Click(Object sender, EventArgs e) in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\Login.aspx.cs:line 43
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
you only have Windows Authentication enabled at your server, therefore the SQL Server tries to logon the user with WIndows Authentication. I guess that the LeanUser is a SQL Server User right ? Therefore you will have to use and enable SQL Server authentication first. See my Screencast on my site for more information how to switch from Windows Auth. to Mixed Auth. (SQL Server & Windows Auth).
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
No comments:
Post a Comment