trying to connect to a db

Results 1 to 2 of 2

Thread: trying to connect to a db

  1. #1
    Join Date
    Dec 1969

    Default trying to connect to a db

    I&#039;m trying to connect to a Database in my sql server.. I have tried everything but i don&#039;t get it to work.. here is my code<BR><BR>con = New SqlConnection("data source=(local);database=friends;user id=sa;Trusted_Connection=yes")<BR><BR>cmd = New SqlCommand(sql, con)<BR>con.Open()<BR><BR>This is the error that appears<BR><BR>System.Data.SqlClient.SqlException: Login failed for user &#039;LONDONASPNET&#039;.<BR><BR>Any help would be greatly appreciated<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: trying to connect to a db

    Check your security settings on your SQL server..<BR><BR>Check to see if it uses windows security or <BR>sql server and windows authentication.<BR><BR>From what it appears your application is trying to login with windows security and you have not given &#039;LONDON/ASPNET&#039; and access rights to your sql server.<BR><BR>A quick fix( but very unsecure and not recommended because your server would be open to &#039;sa&#039;) would right click your server in SQL server administratr and under the security tab click SQL Server and Windows authentication

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts