EF6-DBFirst-Demo icon indicating copy to clipboard operation
EF6-DBFirst-Demo copied to clipboard

Pulled Copy - Cannot Attach DB

Open scourgedunord9 opened this issue 4 years ago • 3 comments

Greetings!

I pulled a copy of this to learn a little more about EF6 and it's possibilities. After extracting the ZIP, I was unable to attach the database to my MSSQL 2019 instance. I checked permissions and ensured MSSQL have full rights to the directory and file. But, no matter what I do, attach fails with an file access error.

scourgedunord9 avatar Jun 21 '21 14:06 scourgedunord9

The same is happening to me right now... SQL Server asks for a log file as well apart from the mdf....

Check this out: https://www.mssqltips.com/sqlservertip/1894/attach-sql-server-database-without-log-file/

it's a very simple solution!

DimitraK92 avatar Aug 24 '21 13:08 DimitraK92

Right click on SchoolDB.mdf -> select Properties -> go to Security tab -> make sure local users, admin and other users has full rights, if not then edit permissions and check full control checkbox and click ok. After this you should be able to attach SchoolDB.mdf file.

entityframeworktutorial avatar Aug 25 '21 06:08 entityframeworktutorial

The same is happening to me right now... SQL Server asks for a log file as well apart from the mdf....

Check this out: https://www.mssqltips.com/sqlservertip/1894/attach-sql-server-database-without-log-file/

it's a very simple solution!

it worked like a breeze

misterraj7 avatar Mar 10 '22 15:03 misterraj7

hello iwas able to attach the mdf file by slecting the script option and i comment out the line for the ldf and it added it autonatically but my issue is when i try to run your program i get namespace error why? your readme file just says connect in app config to my server which i did add the mdf file which i did and then run the program but it fails w/ namespace erros

lisawebcoder avatar Nov 13 '22 17:11 lisawebcoder

also where is your form.cs and form desgn? i dont see it in explsor solutin i am using 2019 that should not be an issue thxz

lisawebcoder avatar Nov 13 '22 17:11 lisawebcoder

i just deleted your edmx and added my own and i still cant display it why

lisawebcoder avatar Nov 13 '22 17:11 lisawebcoder

your project has all kinds of erros in spite i folowed all the steps

lisawebcoder avatar Nov 13 '22 17:11 lisawebcoder

when i added the new edm i named it School and the test connection is good so why the erros?

lisawebcoder avatar Nov 13 '22 17:11 lisawebcoder

i was able to crete th edmx diagram but the code has all kinds of errors so unless someone can jhelp me then i iwll just leave it thank you

lisawebcoder avatar Nov 13 '22 17:11 lisawebcoder

i was able to crete th edmx diagram but the code has all kinds of errors so unless someone can jhelp me then i iwll just leave it thank you

Send error details to [email protected], we will help you out.

entityframeworktutorial avatar Nov 14 '22 10:11 entityframeworktutorial

[email protected]

this email address is not good

i was able to crete th edmx diagram but the code has all kinds of errors so unless someone can jhelp me then i iwll just leave it thank you

iwqs told from github repo response to write to you here

i follow your very simple steps i download your project and unzip i open it in VS2019 i put my computer db server name in app config i delete the edmx and made my own and called the model School i then test the db connection its good and i see the edmx diagram in VS but there all kinds of entity type erros it seems like 50 erros i see the SchoolDBEntities in the exploer and it gives errors in the code

hope this is detailed for you to debug

kind regards Lisa

lisawebcoder avatar Nov 14 '22 15:11 lisawebcoder

ok the email was sent i copy from your website directly

kind regards

lisawebcoder avatar Nov 14 '22 15:11 lisawebcoder