473,385 Members | 1,267 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ConfigurationManager.ConnectionStrings

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(_Connection String).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.Connecti onStrings(_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/lib...onstrings.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

Oct 10 '06 #1
1 12641
I just solved this problem.

Thank You Anyway,
Miguel

shapper wrote:
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(_Connection String).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.Connecti onStrings(_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/lib...onstrings.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
Oct 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dave | last post by:
I am a user of the ConfigurationSettings.AppSettings("KeyName") in asp.net 1.1 so after reading about the new ConnectionStrings collection in "Intoducing Microsoft ASP.NET 2.0 by Dino Esposito on...
4
by: Andy Sutorius via DotNetMonster.com | last post by:
I am creating a custom sitemap and when I run the site I get the following error and the debugger trips on line 28 of the code below. Can someone explain why I am getting this error and how to...
1
by: Dean Slindee | last post by:
With the following three statements in an ApplicationEvents.vb file, I get a message saying "Name 'ConfigurationManager' is not declared." on the third statement. Imports System.Configuration ...
3
by: Mark | last post by:
I am trying to read the appsettings section of a configuration file using the ConfigurationManager object (ASP.NET application) with the following three lines but for some reason the...
4
by: Jim in Arizona | last post by:
I've been using VB 2005 for a few years now. My entire coding history is VB related. This weekend I decided to start learning C#. I'm at work now and decided to do some coding in C# that I would...
2
by: Charlie | last post by:
Hi: Program runs and compiles fine, but WinForms designer breaks when using this line of code... ConfigurationManager.ConnectionStrings.ToString(); It says "Object reference not set to an...
0
by: =?Utf-8?B?cGVsZWdrMQ==?= | last post by:
i work on winxp with Net2 ver 2.0.50727 in the IIS (under ASP.NET) in my web.config file i have : <configuration> <connectionStrings> <add name="local_con" connectionString="Data...
2
by: jandeerit | last post by:
Hi, This code in VS2005 is running fine.. using System.Configuration .... public static string ConnectionString { get { return...
1
by: coltrane | last post by:
I am trying to store and retrieve connection string info from an app's config file and I am having trouble retrieving the connection string info. I stored the info with the following: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.