Permissions needed to connect to ASPNETDB on SQL Server 2005

Posted on 2009-02-20
Last Modified: 2012-06-22
Hi all.  I've just created ASPNETDB on my SQL Server 2005 and currently it has the following users: dbo, guest, INFORMATION_SCHEMA and guest.  I'm assuming in my web.config file that I have to provide a username and password to this database.  However, it seems that I can't add the current username and password that I am using to connect to the database to the ASPNETDB in the usual way.  Can someone help me with this as I'm a newbie at this and can't find this information anywhere.

Thanks so much.
Question by:Finlay11
    LVL 27

    Accepted Solution

    Once you log on the sql server in sql server 2005 management studio, go to:
    security -> Logins -> right click to 'New Login'
    Add login name, select Windows / SQL Server Auth (pwd reqd)
    Click on 'Server Roles' and select appropriate role
    Click on 'User Mapping' and associate the ASPNETDB database to the user you just created.

    Change the connection string in your web.config as follows:

    <add key="ASPNETDBConxn" value="Data Source=myServerAddress;Initial  Catalog=ASPNETDB;User  Id=myUsername;Password=myPassword;" />
    LVL 15

    Expert Comment

    You'll want to add the ASPNET user, the "NT Authority\Network Service", or the IIS WP user to your DB as a user, and then give it access to your database.  It depends on what OS, and what version of IIS you are using.
    LVL 8

    Expert Comment

    There are two types of security  modes on sql server.
    1. Windows authentication mode  
    2. Mixed mode(sqlserver and windows authentication mode).

    You must  set to mixed mode on the sql server to be able to login from application providing username/password combination on web.config.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now