You may be missing the System.Data.SqlClient NuGet package, try adding it.
VB.NET Unable to solve error BC30002
Giacomo Raucci
346
Reputation points
While attempting to convert an Excel VBA to VB.NET, got BC30002 error. After reviewing some of the logs, still unable to resolve. Here is some information on my code:
The BC30002 error info is provided below. Statement Line 35 is also provided.In addition, the Imports statements as well. Please let me know if you need any other information. I am currently using Visual Studio 2022. Thank you for your help.
-------
Severity Code Description Project File Line Suppression State
Error BC30002 Type 'SqlConection' is not defined. HOHAdminWin C:\Users\HOH-IT-Admin\source\repos\HOHAdminWin\HOHAdminWin\HOHAdmin.vb 35 Active
------
(1st 7 lines of HOHAdmin.vb)
Option Explicit On
Option Strict On
Imports System
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Data
Imports System.Data.OleDb
Imports System.Windows.Forms
-----
(line 35) Dim conn As SqlConection
Accepted answer
-
Andy De George 90 Reputation points Microsoft Employee
2023-07-13T18:17:40.4866667+00:00
2 additional answers
Sort by: Most helpful
-
Viorel 119.6K Reputation points
2023-07-12T12:18:33.8866667+00:00 Try this: Dim conn As SqlConnection.
-
Dewayne Basnett 1,371 Reputation points
2023-07-13T19:02:09.66+00:00 Copy and paste this and see what happens
Dim conn As System.Data.SqlClient.SqlConnection