Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET'

System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET'

Scheduled Pinned Locked Moved ASP.NET
asp-netdatabasehelptutorialquestion
3 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    oOomen
    wrote on last edited by
    #1

    hello, i get this error-> System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET' do some one knows how to solve it? i am new to sql and i use msde. thank u in advance

    A B 2 Replies Last reply
    0
    • O oOomen

      hello, i get this error-> System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET' do some one knows how to solve it? i am new to sql and i use msde. thank u in advance

      A Offline
      A Offline
      Albert Pascual
      wrote on last edited by
      #2

      Can you post the complete error? However I believe must be your Connection String: SqlConnection myConnection = new SqlConnection("server=127.0.0.1;user id=sa;password=yourpassword;database=yourdatabase""); SqlCommand myCommand = new SqlCommand(sQuery, myConnection); myConnection.Open(); myCommand.ExecuteNonQuery(); Make sure you have a username/password set up on the SQL serve that has access to that database. Albert

      1 Reply Last reply
      0
      • O oOomen

        hello, i get this error-> System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET' do some one knows how to solve it? i am new to sql and i use msde. thank u in advance

        B Offline
        B Offline
        Bill Dean
        wrote on last edited by
        #3

        Sounds like you are using Windows Authentication to connect to the database server. If this what you intend, then make sure either: 1) you set up the ASPNET user on your machine to have access to the database or 2) you run your asp.net under a user that has access to the database. I would recommend 1) if possible. If you intent to use sql authentication, then Albert's suggestion is the way to go. Though you should try to get away from using the sa login in applications...it's just not a good idea to have GOD access for the code your users are running. Hope this helps. Bill. ps: send along the connection string...that'll help.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups