473,394 Members | 1,703 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,394 software developers and data experts.

Connection string not working

In VS 2008, I am trying to get my connection from my web.config file but it
is coming up empty.

My code:

Dim ConnectionString As String =
System.Configuration.ConfigurationManager.AppSetti ngs("AssociatesConnectionString")

ConnectionString is nothing after this line.

My web.config has it set as:

<connectionStrings>
<add name="AssociatesConnectionString" connectionString="Data
Source=PTERADON\AW3000_INSTANCE;Initial
Catalog=CSpearAndAssociates;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

Why doesn't it pick up this value?

Thanks,

Tom
Sep 15 '08 #1
1 797
Figured it out.

It needs to be:

System.Configuration.ConfigurationManager.Connecti onStrings("AssociatesConnectionString").Connection String

Thanks,

Tom

"tshad" <tf*@dslextreme.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
In VS 2008, I am trying to get my connection from my web.config file but
it is coming up empty.

My code:

Dim ConnectionString As String =
System.Configuration.ConfigurationManager.AppSetti ngs("AssociatesConnectionString")

ConnectionString is nothing after this line.

My web.config has it set as:

<connectionStrings>
<add name="AssociatesConnectionString" connectionString="Data
Source=PTERADON\AW3000_INSTANCE;Initial
Catalog=CSpearAndAssociates;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

Why doesn't it pick up this value?

Thanks,

Tom


Sep 15 '08 #2

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

Similar topics

1
by: vighnesh | last post by:
Hi All I am dealing a project in ASP.NET in which I have to establish a connection to SQL Server 2000 database,where the database was located on a remote system. For this I have used...
1
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
8
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource....
6
by: cj2 | last post by:
If from withing one program I want to access multiple databases on a sql server do I need to make multiple connections? The connection string says initial catalog. I'd assume I could denote the...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.