I'm building up a website using C#, whenever I try this
SqlConnection con = new SqlConnection ();
I get the error that SqlConnection
namespace isn't found, but when I do this
System.Data.SqlClient.SqlConnection con;
it works.
Tried to add reference to System.Data.SqlClient
, but couldn't find it the references lists even though System.Data
is added assembly in the web.config
file.
First: Ensure you're referencing System.Data
not System.Data.SqlClient
Then add
using System.Data.SqlClient;
To your namespaces
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With