Error when attempting to open .mdf file in VB.net "The ADO .NET data provider with invariant name 'System.Data.SqlClient' is not registered on this machine."

Andie Caswell 0 Reputation points
2023-04-01T21:35:12.1+00:00

Screenshot 2023-04-01 173129

Hello, I have a project that is due in my Visual Basic programming class in 1 week. I have had constant issues while messaging my professor back and forth and neither of us can figure it out. I have spent four hours today alone trying to discover what is wrong.

I have to integrate my Visual Studio Tag Sale project into a database. I have SQL Server 2019 and 2022 installed, as well as Microsoft SQL Server Management Studio (which I need to use to create the database itself). I have been able to go into my Visual Basic project under Projects > Add Existing Item and add the item given to us for the project: ItemDatabase.mdf. Whether I create the new .mdf file myself from scratch, or add the existing file, I am unable to right click and open it so that it will go under Server Explorer. When I right click and open it, it says this: "The ADO .NET data provider with invariant name 'System.Data.SqlClient' is not registered on this machine."

I have looked over many others asking the same question on this issue, but the problem with mine is that it's slightly different than all of the others. I have followed others' advice with adding references to System.Data.SqlClient in the App.config (that I just added) but nothing has worked. I also added a reference in the code for my project itself:

Imports System.IO

Imports System.Data

Imports System.Data.SqlClient

The code below is what I put in my App.config. Any advice is welcome, and please keep in mind I am extremely inexperienced with coding and everything all-in-all so I may need extra clarification or ask more questions. Thank you in advance.

Edit: I have also installed the ADO .NET drivers but it has also not worked.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<configSections>
		<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
	</configSections>
	<entityFramework>
		<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
			<parameters>
				<parameter value="System.Data.SqlClient" />
			</parameters>
		</defaultConnectionFactory>
		<providers>
			<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
		</providers>
	</entityFramework>
</configuration>

.NET F#
.NET F#
.NET: Microsoft Technologies based on the .NET software framework.F#: A strongly typed, multi-paradigm programming language developed by the F# Software Foundation, Microsoft, and open contributors.
92 questions
0 comments No comments
{count} votes