Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6619159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:55:52+00:00 2026-05-25T20:55:52+00:00

I have the following in my web.config: <configuration> <connectionStrings> <add name=strConDev connectionString=Data Source=dbSource;Initial Catalog=CatalogInitial;User

  • 0

I have the following in my web.config:

<configuration>
  <connectionStrings>
    <add name="strConDev" connectionString="Data Source=dbSource;Initial     Catalog=CatalogInitial;User Id =DEFAULT; Password=PASSWORD" />
  </connectionStrings>
</configuration>

I am trying to retrieve the connection string in my global.asa in the Application_Start method with the following code:

        var con = ConfigurationManager.ConnectionStrings["strConDev"];
        string strConn = con.ConnectionString;

However, this is always returning a null value to con. What am I doing wrong here? This is the syntax I was able to find online.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:55:53+00:00Added an answer on May 25, 2026 at 8:55 pm

    The syntax all appears correct. A couple things you can try:

    • Copy/paste the connection name from web.config into your code to ensure the names match correctly.
    • Ensure the web.config is correctly formatted. Open it, give the compiler a few seconds to verify it, then check your error list for any warnings. i.e. You may have incorrectly typed <connectionStrings> or you may not have added elements into the correct sections
    • Are you publishing the website or debugging it? If publishing, ensure you don’t have any transformations changing the web.config connection strings – verify this by checking the publish location and opening the web.config there to see if it matches your original.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If have the following web.config : <configuration> <system.web> <authentication mode=Forms> <forms name=MembershipCookie loginUrl=Login.aspx protection=All
Say I have the following web.config: <?xml version=1.0 encoding=utf-8?> <configuration> <system.web> <authentication mode=Windows></authentication> </system.web>
I have the following section added to my web.config: <system.webServer> <caching> <profiles> <add extension=.html
I have the following web config file. I am having some difficulty in retrieving
I am using IIS V5.1. Integrated windows authentication I have a following web config:
I have the following in my web.config: <location path=RestrictedPage.aspx> <system.web> <authorization> <allow roles=Group1Admin, Group3Admin,
I have the following code in a web.config file of the default IIS site.
I have the following code: SPList list = web.Lists[this.ListName]; SPListItem item = list.Items.Add(); now
I have the following ASP.NET Membership section defined in the Web.config file: <membership defaultProvider=AspNetActiveDirectoryMembershipProvider>
Assume I have the following in my web.config (most of the file omitted for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.