none
Reference System.Data.SqlClient not found RRS feed

  • Question

  • I have a fresh Visual Studio 2017 Professional install. I'm building a quick POC Console application using .NET 4.7.1, and I'm unable to find the reference for System.Data.SqlClient.

    I have scoured my system, and located 4 versions of System.Data.SqlClient.dll, but none are correct and won't compile.

    I have also attempted to use System.Data, but no reference to SqlClient is located within.

    I have manually added the dll/reference for System.Data, but also did not resolve the reference issue.

    My application is really simple at the moment, and it will NOT compile due to this missing reference.

    What steps do I need to do to get this resolved?

    my using statements are:

    using System;

    using System.Data;

    using System.Data.SqlClient;

    Thank you,

    Allan

    Wednesday, February 28, 2018 4:06 PM

All replies

  • This issue is resolved.  Microsoft has removed System.Data.SqlClient from the default installation of Visual Studio (.NET Core). In order to use it, you must install from NuGet as install-package System.Data.SqlClient.  Once installed, this reference is available for use and code will compile.
    Wednesday, February 28, 2018 6:14 PM
  • Hi AllanLockridge,

    Please mark the solution as answer. This will make answer searching easier in the forum and be beneficial to community members.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 1, 2018 2:07 AM
    Moderator
  • The problem is the code is still failing to compile even after adding the nugget package

    Friday, November 30, 2018 8:47 AM
  • At the moment you make a new project, you have to create a Class Lybary (.NET Framework), instead of (.NET Standard), so the program use the .NET Framework to make classes.
    Wednesday, May 1, 2019 10:13 PM
  • What is the error message being shown now?

    Even if that's .NET Core project, adding corresponding package from NuGet (Right click your project in "Solution Explorer" and "Manage NuGet Packages...", then search and install it from there) should fix it.

    Thursday, May 2, 2019 12:59 AM
    Answerer
  • What is the error message being shown now?

    Even if that's .NET Core project, adding corresponding package from NuGet (Right click your project in "Solution Explorer" and "Manage NuGet Packages...", then search and install it from there) should fix it.

    Thanks a lot.It solved the issue relating to adding a  System.Data.OleDb reference
    Wednesday, November 6, 2019 12:12 PM