Showing posts with label exception. Show all posts
Showing posts with label exception. Show all posts

Wednesday, March 21, 2012

Login failed for user

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

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 'NT AUTHORITY\NETWORK SERVICE'.

Source Error:

Line 15: Dim cmd As New SqlCommand
Line 16: con6 = New SqlConnection("Server=localhost;UID=sa;PWD=XXXX;Database=knowledge;integrated security=sspi")
Line 17: con6.Open()
Line 18: cmd.CommandText = "select Status from usr where Uid='" & txtUsername.Text & "' and Pass='" & txtPassword.Text & "'"
Line 19: cmd.Connection = con6


Source File:D:\Visual Studio 2005\Projects\WebApplication11\WebApplication11\login.aspx.vb Line:17

When I try the same code at my home computer it gives the same error as

Login failed for user 'BLACK-HULK\ASPNET'.

I am using XP at home and Server 2003 at the other computer, while debugging the application seems to be working fine dunno wat goes wrong while running it directly



I am not 100% sure, but when you use Integrated Security, the connection looks into windows and see who is logged on (basically). Thats why it says: LOGIN FAILED FOR USER 'BLACK-HULK\ASPNET.

As I see it, it gives no meaning of adding UID and PWD when you use Integrated Security.

Can you try removing Integratied security from you connectionstring.

|||

I would highly recommend against accessing your database with sa as a login. Also, as suggested before, using integrated security, kind of defeats the purpose of putting in a username and password ;)

HTH.

Peter

login failed for use null

I have an extended web application to MS CRM 3.0 that is simply trying to
populate some values from the filtered views.
I receive an SQL Exception Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection when accessing from client
machines. I do have "Integrated Security=sspi" in the connection string.
It works fine from the MS CRM Server. It works from my desktop only when I
have remote desktop connection to the MS CRM server and opened the extended
application from there.
Does anyone have a solution to this?
Thanks
DevCheck if this applies to you:
http://support.microsoft.com/kb/909509/en-us
"Dev" wrote:
> I have an extended web application to MS CRM 3.0 that is simply trying to
> populate some values from the filtered views.
> I receive an SQL Exception Login failed for user '(null)'. Reason: Not
> associated with a trusted SQL Server connection when accessing from client
> machines. I do have "Integrated Security=sspi" in the connection string.
> It works fine from the MS CRM Server. It works from my desktop only when I
> have remote desktop connection to the MS CRM server and opened the extended
> application from there.
> Does anyone have a solution to this?
> Thanks
> Dev
>

login failed for use null

I have an extended web application to MS CRM 3.0 that is simply trying to
populate some values from the filtered views.
I receive an SQL Exception Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection when accessing from client
machines. I do have "Integrated Security=sspi" in the connection string.
It works fine from the MS CRM Server. It works from my desktop only when I
have remote desktop connection to the MS CRM server and opened the extended
application from there.
Does anyone have a solution to this?
Thanks
DevCheck if this applies to you:
http://support.microsoft.com/kb/909509/en-us
"Dev" wrote:

> I have an extended web application to MS CRM 3.0 that is simply trying to
> populate some values from the filtered views.
> I receive an SQL Exception Login failed for user '(null)'. Reason: Not
> associated with a trusted SQL Server connection when accessing from client
> machines. I do have "Integrated Security=sspi" in the connection string.
> It works fine from the MS CRM Server. It works from my desktop only when I
> have remote desktop connection to the MS CRM server and opened the extende
d
> application from there.
> Does anyone have a solution to this?
> Thanks
> Dev
>sql