Showing posts with label ive. Show all posts
Showing posts with label ive. Show all posts

Wednesday, March 28, 2012

Login failed for user . The user is not associated with a trusted SQL Server connection.

I've seen many, many, many, many posts regarding this topic - but none have been able to fully explain nor fix my problem.


I've developed a security solution according toScott Gu's guide and it works great - but only on my local machine running VWD and SQLExp2005. Once I move this application it completely breaks in the productions environment.

Today I managed to get it halfway there. I created a SQL login and changed my web.config to use these credentials - now the web application will come up, but none of my links (that are role based) are displayed - most likely because i'm authenticating as the SQL credentials instead of me.

So I switch it back to windows authenticated, as it is on my laptop, and it breaks again.

Please tell me theres a way to get this working in production and Scott's fantastic tutorial hasn't wasted me 2 weeks of work.

Here's the exact error I get when using Integrated authentication:

Server Error in '/Contracts' Application.

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

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 ''. The user is not associated with a trusted SQL Server connection.

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 ''. The user is not associated with a trusted SQL Server connection.]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +437
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
System.Web.Security.SqlRoleProvider.GetRolesForUser(String username) +771
System.Web.Security.RolePrincipal.IsInRole(String role) +272
System.Web.SiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) +194
System.Web.SiteMapNode.IsAccessibleToUser(HttpContext context) +14
System.Web.StaticSiteMapProvider.GetChildNodes(SiteMapNode node) +348
System.Web.SiteMapNode.get_ChildNodes() +23
System.Web.SiteMapNode.get_HasChildNodes() +4
System.Web.SiteMapNode.System.Web.UI.IHierarchyData.get_HasChildren() +4
System.Web.UI.WebControls.Menu.DataBindRecursive(MenuItem node, IHierarchicalEnumerable enumerable) +4225
System.Web.UI.WebControls.Menu.DataBindItem(MenuItem item) +277
System.Web.UI.WebControls.Menu.PerformDataBinding() +117
System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +82
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.Menu.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.Menu.EnsureDataBound() +29
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e, Boolean registerScript) +21
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e) +22
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

I am not saying it will fix it but it maybe related to your Windows User/Group not having permission in the database when using Windows Authentication. The database permissions are in the new security section in the database in Management Studio. Hope this helps.|||Can you post your Web.config file?sql

Monday, March 19, 2012

login failed Error 18456 Help needed!

I'm a developer who's used mainly SQL Server 2000. I've installed 2005 at
work and use the client tools with no problem.
I have Vista at home, new machine. I installed Sql 2005. I've tried both
system login and Windows Authen. I am the only user and hence an admin on
this box.
I open 2005 Mgmt Studio. I want to attach databases. But I can't even get my
Database engine to connect, despite that fact my Server shows up in
Registered Servers.
When I choose Connect, I then browse for Server(only one), I use Windows
Auth and get error Login failed for user ....error 18456.
Something this simple, shouldn't be so difficult.
While I've connected at work with no problem, I guess that's the issue,
there was no problem and since I'm not a newbie, I'm kinda pissed off. Can
anyone help me?
Since I'm at home for the next 3 days, and since I'm registered using my
work email address, I'd appreciate a direct email to me at
matthewmark@.verizon.net.
Thanks,
Matthew Mark
What's the error state and error description in the SQL Server log
files? They should give you a more detailed reason why you can't
logon.
Check if this helps:
http://eventid.net/display.asp?eventid=18456&eventno=8175
&source=MSSQLSERVER&phase=1
__________________________________________________ _______
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
SQL troubleshooting: http://sql.veranoest.net
___ please respond in newsgroup, NOT by private email ___
=?Utf-8?B?TWF0dGhldyBNYXJr?=
<MatthewMark@.discussions.microsoft.com> wrote on 11 nov 2007 in
microsoft.public.sqlserver.connect:

> I'm a developer who's used mainly SQL Server 2000. I've
> installed 2005 at work and use the client tools with no problem.
> I have Vista at home, new machine. I installed Sql 2005. I've
> tried both system login and Windows Authen. I am the only user
> and hence an admin on this box.
> I open 2005 Mgmt Studio. I want to attach databases. But I can't
> even get my Database engine to connect, despite that fact my
> Server shows up in Registered Servers.
> When I choose Connect, I then browse for Server(only one), I use
> Windows Auth and get error Login failed for user ....error
> 18456.
> Something this simple, shouldn't be so difficult.
> While I've connected at work with no problem, I guess that's the
> issue, there was no problem and since I'm not a newbie, I'm
> kinda pissed off. Can anyone help me?
> Since I'm at home for the next 3 days, and since I'm registered
> using my work email address, I'd appreciate a direct email to me
> at matthewmark@.verizon.net.
> Thanks,
|||In the server erro log you can fine an entry related to the error.
Check the description of the STATE code here:
http://msdn2.microsoft.com/en-us/library/ms366351.aspx
i hope this help !!!
Claudio Riefolo
MCSE - VCP
"Vera Noest" wrote:

> What's the error state and error description in the SQL Server log
> files? They should give you a more detailed reason why you can't
> logon.
> Check if this helps:
> http://eventid.net/display.asp?eventid=18456&eventno=8175
> &source=MSSQLSERVER&phase=1
> __________________________________________________ _______
> Vera Noest
> MCSE, CCEA, Microsoft MVP - Terminal Server
> SQL troubleshooting: http://sql.veranoest.net
> ___ please respond in newsgroup, NOT by private email ___
> =?Utf-8?B?TWF0dGhldyBNYXJr?=
> <MatthewMark@.discussions.microsoft.com> wrote on 11 nov 2007 in
> microsoft.public.sqlserver.connect:
>
|||I'm not sure I understand, but I think your problem is that you are relying
on your membership in the local administrators group for permission to
connect. Vista doesn't give you that permission automatically. So try the
"Run as Administrator" option when you start Management Studio. After you
connect, add your own login as to the SQL Server. Then in the future you
won't have to run as administrator.
Rick Byham (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Matthew Mark" <MatthewMark@.discussions.microsoft.com> wrote in message
news:0282CF87-7003-4CFB-8C0B-C8BC88BAD87C@.microsoft.com...
> I'm a developer who's used mainly SQL Server 2000. I've installed 2005 at
> work and use the client tools with no problem.
> I have Vista at home, new machine. I installed Sql 2005. I've tried both
> system login and Windows Authen. I am the only user and hence an admin on
> this box.
> I open 2005 Mgmt Studio. I want to attach databases. But I can't even get
> my
> Database engine to connect, despite that fact my Server shows up in
> Registered Servers.
> When I choose Connect, I then browse for Server(only one), I use Windows
> Auth and get error Login failed for user ....error 18456.
> Something this simple, shouldn't be so difficult.
> While I've connected at work with no problem, I guess that's the issue,
> there was no problem and since I'm not a newbie, I'm kinda pissed off. Can
> anyone help me?
> Since I'm at home for the next 3 days, and since I'm registered using my
> work email address, I'd appreciate a direct email to me at
> matthewmark@.verizon.net.
> Thanks,
>
> --
> Matthew Mark
>