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. General Programming
  3. C#
  4. problem in reading of connection string inside app.config by application

problem in reading of connection string inside app.config by application

Scheduled Pinned Locked Moved C#
questionsecuritysaleshelpworkspace
3 Posts 3 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.
  • M Offline
    M Offline
    Mohamed El Wehishy
    wrote on last edited by
    #1

    i found my problem my problem is the application is not read the connection string in app.config so when i start with debugging, it is all write but when start without debugging the exception is thrown another thing when i clear the comming from machine.config as the following code <configuration> <clear/> <connectionStrings> <add name="ConnectionString" connectionString="Data Source=.;Initial Catalog='Computer Sales System';Integrated Security=True"/> </connectionStrings> </configuration> the exception is thrown in both sides so i understand that the connection string in app.config is not read by application so i want to know why???????? and what is the solution for this problem thanks

    P L 2 Replies Last reply
    0
    • M Mohamed El Wehishy

      i found my problem my problem is the application is not read the connection string in app.config so when i start with debugging, it is all write but when start without debugging the exception is thrown another thing when i clear the comming from machine.config as the following code <configuration> <clear/> <connectionStrings> <add name="ConnectionString" connectionString="Data Source=.;Initial Catalog='Computer Sales System';Integrated Security=True"/> </connectionStrings> </configuration> the exception is thrown in both sides so i understand that the connection string in app.config is not read by application so i want to know why???????? and what is the solution for this problem thanks

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Don't use app.config -- write your own configuration file.

      1 Reply Last reply
      0
      • M Mohamed El Wehishy

        i found my problem my problem is the application is not read the connection string in app.config so when i start with debugging, it is all write but when start without debugging the exception is thrown another thing when i clear the comming from machine.config as the following code <configuration> <clear/> <connectionStrings> <add name="ConnectionString" connectionString="Data Source=.;Initial Catalog='Computer Sales System';Integrated Security=True"/> </connectionStrings> </configuration> the exception is thrown in both sides so i understand that the connection string in app.config is not read by application so i want to know why???????? and what is the solution for this problem thanks

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        <clear/> should appear between <connectionStrings> and </connectionStrings>

        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