Connection string - Keyword not supported: 'initial catalog'

后端 未结 6 1683
北荒
北荒 2020-12-03 10:47

I am using Webmatrix.data\'s Database entity to create a database connection, however it doesnt like my connection string. I am running it from MVC ASP.net.

Ive tri

6条回答
  •  无人及你
    2020-12-03 11:24

    I ran into the error in one of the IdentityServer quickstarts.

    Had to replace

    services.AddDbContext(options =>
                    options.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));
    

    With

    services.AddDbContext(options =>
                    options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
    

    Using

    Microsoft.EntityFrameworkCore.SqlServer
    

    Because obviously my DB was a Microsoft SQL Server and not SQLite.

提交回复
热议问题