SqlConnection and SqlDataAdapter not found in vb.net 6.0

Anthony White 21 Reputation points
2022-10-31T16:31:22.663+00:00

I am trying to write a simple application to access an SQL database, but cannot reference SqlConnection or SqlDataServer. I've added
System.Data
System.Data.SqlClient
System.Data.OleDb

to the project.

Once again, this is using vb.net 6.0

Developer technologies .NET Other
Developer technologies VB
SQL Server Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2022-10-31T22:52:53.837+00:00

    net 6 no longer includes System.Data.SqlClient as Microsoft.Data.SqlClient is the recommend replacement. you must use a nuget package to induce the old or new package.


  2. Anthony White 21 Reputation points
    2022-11-04T22:04:11.137+00:00

    Thanks for the help.

    I think I am going to just switch to C# for my .NET endeavors.

    I am an old C++ hack. The C# examples work (I've been having a LOT of problems getting the VB examples to work with .NET 6 for what should be simple stuff), and C# just make more sense to me in terms of styling.

    This may be going off topic for this question, but anyone feel free to tell me that I am wrong, and stick with VB...


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.