views:

164

answers:

2

this is a different question concerning:

http://stackoverflow.com/questions/2360433/add-a-connection-to-database-not-working-asp-net-to-mdf

i am unable to connect because of the noted error message

the database must be read only? but when i click the properties of the file read only is not checked

is there another way it could be read only?

+1  A: 

Yes definitely - you can set a filegroup inside a MDF file to be read-only - only that shouldn't prevent you from connecting to it - just from altering anything inside it.

marc_s
And an entire database can be set to read only as well.
Peter Schofield
great thank you marc, so how do i change it?
I__
can you attach the .MDF to a full (non-Express) edition of SQL Server? You could then use SQL Server Mgmt Studio to undo the "read-only" flag on your filegroup(s).
marc_s
no unfortunately id o not have a full version
I__
A: 

if you trying to mdf as attached file like Driver=SQL Server; Server=.\SQLEXPRES; AttachDbFilename=c:\mydbfile.mdf;Database=myDB; Trusted_Connection=Yes; make sure to set on this file full windows permissions to Users via property tab

stranger