runtime
runtime copied to clipboard
The type name 'SqlConnection' could not be found in the namespace 'System.Data.SqlClient'
Hi,
Why this happens? Should I install another package instead of System.Data.SqlClient?
Reinstalling System.Data.SqlClient fixed the problem!
@dehghani-mehdi also check https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/.
Solution:
- Right Click on your project file in the solution panel, and then click on the Manage NuGet Packages option.
- In the NuGet Package Manager window, Select the Browser Tab. Search for System.Data.SqlClient and Press enter
- 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