View Single Post
  #1 (permalink)  
Old May 17th, 2006, 03:00 PM
belete belete is offline
Authorized User
Join Date: Jun 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.Data.SqlClient.SqlException: Login failed f

Hi all,

Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?

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.

Here is my code and i am using windows authentication:

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>


    Dim connAkaki As SqlConnection
    Dim cmdSelectAuthers As SqlCommand
    Dim dtrAuthers As SqlDataReader

    connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki" )


    cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
    dtrAuthers= cmdSelectAuthers.ExecuteReader()

    While dtrAuthers.Read()

    End While