Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Help with WebConfigurationManager ??

Help with WebConfigurationManager ??

Scheduled Pinned Locked Moved ASP.NET
helpquestionworkspace
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Imran Adam
    wrote on last edited by
    #1

    Hi I have this line of code in my Web Application; string connect = WebConfigurationManager.ConnectionString s["Scrabble"].Connection String; It will not compile as i am getting the following error: "The name 'WebConfigurationManager' does not exist in the current context" If i add Using System.Web.Configuration to the top of the page, it will compile. However it falls over again on the same line with the message: "Object reference not set to an instance of an object" What am i doing wrong here??? Thanks again

    Cheers :)

    I A 2 Replies Last reply
    0
    • I Imran Adam

      Hi I have this line of code in my Web Application; string connect = WebConfigurationManager.ConnectionString s["Scrabble"].Connection String; It will not compile as i am getting the following error: "The name 'WebConfigurationManager' does not exist in the current context" If i add Using System.Web.Configuration to the top of the page, it will compile. However it falls over again on the same line with the message: "Object reference not set to an instance of an object" What am i doing wrong here??? Thanks again

      Cheers :)

      I Offline
      I Offline
      Imran Adam
      wrote on last edited by
      #2

      Aah sorted.... :) Just for the record I added this to my web.config: <connectionStrings> <add name="ScrabbleConnectionString" ; connectionString="Data Source=JETTA\SQLEXPRESS;Initial Catalog=Scrabble;Integrated Security=True" providerName="System.Data.SqlClient " /> </connectionStrings> I also added the name of the "connectionString" to the line in my code that was causing the problem, I.E: string connect = WebConfigurationManager.ConnectionString s["ScrabbleConnectionString&# 034;].Co nectionString; Thanks Cheers :)

      1 Reply Last reply
      0
      • I Imran Adam

        Hi I have this line of code in my Web Application; string connect = WebConfigurationManager.ConnectionString s["Scrabble"].Connection String; It will not compile as i am getting the following error: "The name 'WebConfigurationManager' does not exist in the current context" If i add Using System.Web.Configuration to the top of the page, it will compile. However it falls over again on the same line with the message: "Object reference not set to an instance of an object" What am i doing wrong here??? Thanks again

        Cheers :)

        A Offline
        A Offline
        Anudeep Jaiswal
        wrote on last edited by
        #3

        use configurationmanager instead of webconfigurationmanager

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups