Avatar of cmdolcet
cmdolcet
Flag for United States of America asked on

Getting an error when trying to connect using the SqlConnection

I am getting the following error when  write out this line of code.

Imports System.Data
Imports System.Data.SqlClient
 Dim conStr As String = "SERVER=LMI167\DBTEST;Database =ORKA Test; trusted_connection= yes"
        Dim objcon As New SqlConnection(conStr)

Open in new window


Reference required to assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' containing the base class 'System.ComponentModel.Component'. Add one to your project.
Visual Basic.NET

Avatar of undefined
Last Comment
cmdolcet

8/22/2022 - Mon
ste5an

Check your projects properties first:

Capture.PNG
When you need .NET 2.0 as destination target, then you need to select it there.
ASKER CERTIFIED SOLUTION
cmdolcet

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy