How to refer to Assembly in Visual Studio?

Asked

Viewed 1,648 times

-1

I was trying to create an application that connects with a database. But the methods of SqlConnection.Open(), SqlConnection.State and SqlConnection.Close() are with errors all appear the message:

The "Component" type is defined in an Assembly that is not referenced, you must add a reference to Assembly[...] Erro

  • Dependencies => assemblies => right-click => add

  • You do not have "Add".

  • In dependencies you must have. Somewhere you need to have this, just make a little effort you think.

  • I did, but how to know which dependency needs to be added?

  • See my answer

  • Already solved your problem?

  • No, I gave up, created a new project and this error did not appear anymore.

Show 2 more comments

1 answer

0

You need to add the file System.Data.dl to your project.

Click dependencies, add and choose the Assembly.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.