locked
Entity FrameWork Code First db creation RRS feed

  • Question

  • Hi all,

    I'm a consultant trying to learn Entity Framework Code First on my work laptop. The laptop does not allow me admin rights as part of company policy. I failed to generate a database and the computer gave me an error saying "Additional information: CREATE DATABASE permission denied in database 'master'."

    I believe its because I don't have the rights for this. I know it was trying to create the database in SQLExpress so where and what rights will I need to do this. Do I need only to adjust the rights, read write and execute, of the currently logged on user for SQLExpress or will I need to expand those rights in other places as well.

    Tuesday, May 10, 2016 4:31 PM

Answers

  • Hi ClooGloo,

    According to your error message, it seems that it's a DB permission issue, please try the following steps, adding the permissions to the user.

    1.Right click you database and then click properties

    2.Go to security tab

    3.Click Continue button

    4.Click Add button

    5.Click Advance button

    6.Another window will show, then you click the "Find Now" button on the right side.

    7.On the fields below, go to the bottom most and click the "Users". Click OK.

    8.Click the permission "Users" that you have been created, then Check the full control checkbox.

    In addition, please check if your connection string has a same name with the name of your derived context class, for more information, please see:

    http://stackoverflow.com/questions/11938230/asp-mvc-3-noobie-create-database-permission-denied-in-database-master

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, May 11, 2016 1:37 AM

All replies

  • Hi ClooGloo,

    According to your error message, it seems that it's a DB permission issue, please try the following steps, adding the permissions to the user.

    1.Right click you database and then click properties

    2.Go to security tab

    3.Click Continue button

    4.Click Add button

    5.Click Advance button

    6.Another window will show, then you click the "Find Now" button on the right side.

    7.On the fields below, go to the bottom most and click the "Users". Click OK.

    8.Click the permission "Users" that you have been created, then Check the full control checkbox.

    In addition, please check if your connection string has a same name with the name of your derived context class, for more information, please see:

    http://stackoverflow.com/questions/11938230/asp-mvc-3-noobie-create-database-permission-denied-in-database-master

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, May 11, 2016 1:37 AM
  • Thanks Cole,

    I haven't specified a database for the program, just using the default SQLExpress. I don't have admin rights to SQLExpress but I do for the other servers on my computer. When I get far enough to specify the server I'll be sure to do that.

    Quick follow up question. Do I need to link visual studio with any database I wish to use or would be specifying the name, location, username, and password in the proper config file be enough to access any database? 

    Thanks,

    Andy

    Wednesday, May 11, 2016 6:09 PM