The type or namespace name ‘SQLConnection’ could not be found

using System.Data.SqlClient;

Along with the above line we need to also check if the actual system assembly reference is there or not. In my case I had the directive but assembly reference was missing.

To add assembly we can do the following.

Browse dll file for SqlClient in and add it.

–or— simpler way is to install nuget package.

Right Click on Project > Manage Nuget Packages > Search & install ‘System.Data.SqlClient’

Make sure it is compatible with the type of project (Core/Standard);

Leave a Comment

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