ConfigurationManager.ConnectionStrings

S

shapper

Hello,

I create a few VB classes under app_code of a web site.
Now I am trying to create a library project.

Something strange is going on. I have the following line:
Dim connectionString As String =
ConfigurationManager.ConnectionStrings(_ConnectionString).ConnectionString

I get an error saying:
Name 'ConfigurationManager' is not declared.

I then tried do add 'Imports System.Configuration.ConfigurationManager'
and I get one more error.

I tried to change the code line to:
Dim connectionString As String =
System.Configuration.ConfigurationManager.ConnectionStrings(_ConnectionString).ConnectionString

And I get the error:
'ConfigurationManager' is not a member of 'System.Configuration'.

But I found this:
http://msdn2.microsoft.com/en-us/li...n.configurationmanager.connectionstrings.aspx

What is going on?

In my web site everything is working. Just now that I am trying to
create the library this is not working.

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top