Wednesday, 4 May 2011

SQL: Login failed for user - computername\aspnet - ASP.NET


  1.  Open SQL Server Management Studio
  2. Create a Database if it is not created already
  3. In the root folder of the SQL Server Management Studio there is a -->Security folder-->Expand it
  4. In order to create login-->Select Login --> Right click
    • Put a login Name
    • Select SQL Server authentication if you want
      • Uncheck - enforce password policy
      • type password
    • Select the default database (optional)
    • User mapping--> (if you select this option the user name with same login name will be created automatically otherwise you have created manually)
      • You can select the database you want to associate & 
      • Select the rights 
        • dbowner
        • datareader
        • datawriter
  5. Creating create user name manually
    • Select the database and expand -->Security-->Users
      • Put a user name (it is better to give a same user name as login name)
      • Select the login name you just have created
      • In the Database role membership select the roles:
        • dbowner
        • datareader
        • datawriter

No comments:

Post a Comment