Simple.Data in ASP.NET Core - 'No Ado Provider found.'

591 views Asked by At

To my application in ASP.NET Core I have added from nuget - Simple.Data.SqlServer.

And in my Code: var db = Database.Open(); in this line I recives an error: "No Ado Provider found"

I assume that it's because my Startup.cs (file is in different project.) Anyway there I have:

services.AddDbContext<DataContext>(options => 
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"), 
b => b.MigrationsAssembly("Aps.API")));

So I was trying to change my db variable to:

var db = Database.OpenConnection("Data Source=.\\SQLEXPRESS;Initial 
Catalog=DataDB;Integrated Security=True;MultipleActiveResultSets=True;");`

Still the same problem.

0

There are 0 answers