SQL Error: 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s