Any solution for error message "Could not attach file 'App_Data\Database.mdf' as database 'Database'

Discussion in 'Microsoft ADO .NET' started by ornit_sagy@yahoo.com, Jan 8, 2007.

  1. Guest

    Hello,
    I'm trying to connect to Database.mdf from an asp.net file and I get
    the following error message:
    Could not attach file 'App_Data\Database.mdf' as database
    'Database'.
    CREATE DATABASE permission denied in database 'master'
    The connection string I use is:

    Provider=SQLNCLI;Server=localhost\SQLExpress;AttachDbFilename=App_Data\Database.mdf;Database=Database;Trusted_Connection=Yes
    Thanks!!!
    Ornit
     
    , Jan 8, 2007
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ad

    How to attach mdf in a relative directory

    ad, Nov 5, 2005, in forum: Microsoft ADO .NET
    Replies:
    1
    Views:
    324
    Sahil Malik [MVP]
    Nov 5, 2005
  2. VB Programmer

    Question: moving around SQLExpress MDF file...

    VB Programmer, Jan 16, 2006, in forum: Microsoft ADO .NET
    Replies:
    1
    Views:
    296
    David Browne
    Jan 16, 2006
  3. Replies:
    9
    Views:
    751
  4. R.A.M.
    Replies:
    3
    Views:
    1,979
    Jesús López
    Dec 17, 2006
  5. Replies:
    1
    Views:
    1,065
    William \(Bill\) Vaughn
    Jan 8, 2007
  6. Tony Girgenti
    Replies:
    6
    Views:
    2,930
    Rory Becker
    Mar 29, 2007
  7. Guest

    Distributing the database mdf file.

    Guest, Jul 6, 2007, in forum: Microsoft ADO .NET
    Replies:
    0
    Views:
    263
    Guest
    Jul 6, 2007
  8. PvdG42

    Connect To .mdf file on Network?

    PvdG42, Nov 13, 2008, in forum: Microsoft ADO .NET
    Replies:
    9
    Views:
    3,598
    Gregory A. Beamer
    Nov 15, 2008
Loading...