PC Review


Reply
Thread Tools Rate Thread

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

 
 
ornit_sagy@yahoo.com
Guest
Posts: n/a
 
      8th Jan 2007
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 coonection string I use is:

Provider=SQLNCLI;Server=localhost\SQLExpress;AttachDbFilename=App_Data\Database.mdf;Database=Database;Trusted_Connection=Yes

Thanks!!!

Ornit

 
Reply With Quote
 
 
 
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      8th Jan 2007
The word "database" is a reserved word. Use "Fred" instead as the database
name.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 coonection string I use is:
>
>
> Provider=SQLNCLI;Server=localhost\SQLExpress;AttachDbFilename=App_Data\Database.mdf;Database=Database;Trusted_Connection=Yes
>
> Thanks!!!
>
> Ornit
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Data.SqlClient.SqlException: An attempt to attach an auto-named database for file "Location" failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. weird0 Microsoft C# .NET 1 20th Apr 2007 10:04 AM
Any solution for error message "Could not attach file 'App_Data\Database.mdf' as database 'Database'."? ornit_sagy@yahoo.com Microsoft ADO .NET 0 8th Jan 2007 08:34 PM
"CREATE DATABASE permission denied in database 'master'. Could not attach file..." R.A.M. Microsoft ADO .NET 3 17th Dec 2006 08:35 PM
An attempt to attach an auto-named database for file c:\inetpub\wwwroot\WebSite\App_Data\aspnetdb.mdffailed Freddie Microsoft ASP .NET 3 26th Jul 2006 02:16 PM
Cannot open database, error states "unrecognized database format". =?Utf-8?B?SmF4bWM=?= Microsoft Access Forms 1 8th Feb 2005 03:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:51 AM.