System.Data.SqlClient.SqlException: CREATE DATABASE

Discussion in 'MCAD' started by mrv, Apr 13, 2004.

  1. mrv

    mrv Guest


    I have just begun my prep for 70-315. I am using the book
    by Jeff webb (Microsoft).

    I get the error (see Note below) when going through
    Chapter 5>Lesson 1: a simple web application to connect
    to a DB, create a dataset and use databinding to display
    the data set.

    I have very limited experience with Databases/SQL Server.
    I am not referencing any "master" DB in my webapp. I am
    trying to access the contacts table in contacts.mdf.

    Any help in this regard would be greatly appreciated.


    CREATE DATABASE permission denied in database 'master'.
    Could not attach database 'Contacts' to
    file 'D:\MCSDWebApps\Chapter05\Contacts.MDF'.
    Description: An unhandled exception occurred during the
    execution of the current web request. Please review the
    stack trace for more information about the error and where
    it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException:
    CREATE DATABASE permission denied in database 'master'.
    Could not attach database 'Contacts' to
    file 'D:\MCSDWebApps\Chapter05\Contacts.MDF'.

    Source Error:

    Line 31: // Put user code to
    initialize the page here
    Line 32: //Fill the dataset
    Line 33: this.sqlDataAdapter1.Fill
    Line 34: //Update the data grid
    Line 35: DataGrid1.DataBind();
    mrv, Apr 13, 2004
    1. Advertisements

  2. mrv

    mrv Guest

    I was able to resolve the below issue.
    However, I am still not sure what caused the issue in the
    first place and what was it that I did, that fixed the

    I did a number of things: recreated the project, creating
    ASPNET, refreshing the projects in the server explorer,
    and a few other things which I cannot remember exactly.

    I will try to isolate the issue and the cause, but any
    insights would be appreciated.

    mrv, Apr 13, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.