I have already tried to add SQLClient reference
using System.Data.SqlClient
But still I got these errors
I have been using macOS
I have already tried to add SQLClient reference
using System.Data.SqlClient
But still I got these errors
I have been using macOS
Open the solutionExplorer
, go to references
, right click on it and choose add reference
. Now browse for the assembly SqlClient
and hit the ok button.
But using the using
statement in your code just saves you some additional words in order to shorten and simplify your code. Imagine if you would have added a reference of the assembly System.Data.SqlClient
to your project, but didn't write using System.Data.SqlClient;
, then you could still create a new SqlConnection
object, but you have to add like an address, which assembly shell be used.
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
But importing the reference needs to be done manual, a few basic assembly references have already been added by default, that's why
using System.Web.Mcv;
knows which referenced assembly is meant. For clarification, have a look at the referenced assemblies in your project and you will find System.Web.Mcv
there, so it has been added there already.