The type or namespace name ‘SqlConnection’ could not be found (are you missing a using directive or an assembly reference?).

You just add the below namespace:

using System.Data.SqlClient;

About the Author

avatar