runtime icon indicating copy to clipboard operation
runtime copied to clipboard

The type name 'SqlConnection' could not be found in the namespace 'System.Data.SqlClient'

Open dehghani-mehdi opened this issue 7 years ago • 3 comments

Hi,

Why this happens? Should I install another package instead of System.Data.SqlClient?

dehghani-mehdi avatar Sep 27 '19 07:09 dehghani-mehdi

Reinstalling System.Data.SqlClient fixed the problem!

dehghani-mehdi avatar Sep 27 '19 08:09 dehghani-mehdi

@dehghani-mehdi also check https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/.

divega avatar Sep 27 '19 08:09 divega

Solution:

  1. Right Click on your project file in the solution panel, and then click on the Manage NuGet Packages option.
  2. In the NuGet Package Manager window, Select the Browser Tab. Search for System.Data.SqlClient and Press enter
  3. Select the first option, System.Data.SqlClient by Microsoft Click on the install button

Wait for the installation to complete. Done.

Source YouTube Video: SqlConnection could not be found in the namespace | Fixed

AsifMahsud avatar Nov 06 '20 08:11 AsifMahsud