none
CodeFirst fails to create new database because user login is refused

    Question

  • I am developing a new application using CodeFirst. The database does not exist, and will be created on an external server.

    When creating the DbContext EF6 comes back with an error, stating that the login of the user failed.

    The user in the connection string can connect to the server and create databases without problems via VS and SqlManagement Studio, and all the permissions seem to be correct.

    I have tried a number of users without successm and I am really stuck.

    Can anybody help?

    Tuesday, April 16, 2019 11:35 AM

All replies

  • The user in the connection string can connect to the server and create databases without problems via VS and SqlManagement Studio, and all the permissions seem to be correct.

    So why can't you use the tools for database administration? I am not a fan of an ORM acting as a DB admonition tool.

    Tuesday, April 16, 2019 6:07 PM
  • Hi PG Mariotti,

    Here I found a similar thread maybe you can refer to:

    Entity Framework Login Failed Error.

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, April 17, 2019 2:40 AM