What is wrong with this code. Why can’t I use SqlConnection?

If you just updated EntityFrameworkCore from version 2.x to 3.x and you’re running into this, change your using statement to Microsoft.Data.SqlClient instead of System.Data.SqlClient. If you’re using EntityFrameworkCore.SqlServer it already has that as a dependency, so you shouldn’t need to install it explicitly. This Microsoft blog explains the change. The Microsoft.Data.SqlClient package, … , will … Read more

How to use SqlClient in ASP.NET Core?

I think you may have missed this part in the tutorial: Instead of referencing System.Data and System.Data.SqlClient you need to grab from Nuget: System.Data.Common and System.Data.SqlClient. Currently this creates dependency in project.json –> aspnetcore50 section to these two libraries. “aspnetcore50”: { “dependencies”: { “System.Runtime”: “4.0.20-beta-22523”, “System.Data.Common”: “4.0.0.0-beta-22605”, “System.Data.SqlClient”: “4.0.0.0-beta-22605” } } Try getting System.Data.Common and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)