Unable to locate System.Data.SqlClient reference

New issue. Microsoft removed System.Data.SqlClient from newer versions of Visual Studio and .NET Core. The fix is to install the NuGet package System.Data.SqlClient. In other words, you might not find the DLL on your system and need to add it using NuGet.

In the Solution Explorer, right-click References and choose "Manage NuGet Packages...". Search for "System.Data.SqlClient". Choose it when found, and Install.

NuGet Package Manager


dotnet add package System.Data.SqlClient


You just have to add reference option in solution explorer and after that, if it is not working you need to change class library use ".net framework" apart from ".net standard"

Tags:

C#

Sqlclient