Tom
Tom

Reputation: 6707

how to read ConnectionStrings

This is not working.. any ideas?

ConfigurationManager.ConnectionStrings("YourConnectionString").ConnectionString

Error

"ConfigurationManager not declared"

Upvotes: 1

Views: 182

Answers (3)

Kobi
Kobi

Reputation: 138017

Also, you may need to add a reference to System.Configuration .

Upvotes: 0

Sam
Sam

Reputation: 6265

And...

Have you added a reference to the System.Configuration assembly?

Upvotes: 2

Jon Skeet
Jon Skeet

Reputation: 1500525

Do you have

Imports System.Configuration

in your code? And a reference to the System.Configuration assembly in your project?

Upvotes: 2

Related Questions