Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    139

    Unanswered: connection to SQL from asp.net page

    I am using an asp.net page with vb.net. The following connection in my web.config file will connect the database to my page no problem:

    "Data Source=MIAPPS1;Initial Catalog=MASTER_DB;Integrated Security=SSPI;"

    However, when I add data to the page and try to preview it in the browser I get the following error:

    "System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."

    I'm kind of perplexed as to why I can attach a database to my page, test the connection view data -but not be able to connect when previewing through the browser.

    Any Ideas?

    Bill
    Thanks,
    Bill

  2. #2
    Join Date
    Feb 2003
    Location
    Milano, Italy
    Posts
    80
    Have you added the ASP.NET account to the server server authorized logins?
    Davide Mauri
    http://www.davidemauri.it

  3. #3
    Join Date
    Mar 2004
    Posts
    139
    I have added an account ASPNET. Is it ASPNET or ASP.NET. The error message also showed, null for the login, does this still point to the ASPNET login issue?
    Thanks,
    Bill

  4. #4
    Join Date
    Feb 2003
    Location
    Milano, Italy
    Posts
    80
    Yes. The errors means that you either trying to connected to SQL with SQL Authication while only Windows Authentication is enabled, or that the windows account you're using is not one enlisted into the sql logins account.

    If you're using IIS5 the account is ASP.NET, if using IIS6 is the Network Service account
    Davide Mauri
    http://www.davidemauri.it

Posting Permissions

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