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. Passing connection information from Application to class library.

Passing connection information from Application to class library.

Scheduled Pinned Locked Moved ASP.NET
questionvisual-studiohelp
2 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.
  • W Offline
    W Offline
    www Developerof NET
    wrote on last edited by
    #1

    Hi all, I have created a class library for my application. I have some typed datasets in this class library. While creating the datasets , VS asked me whether to save the connection string in the config file and it created a seperate app.config file in the class library. What i need is that while calling the class library, i should be able to pass in the connection parameters from my applications web.config file and it should not create ant app.config file. How can i do this??? Any help would be kindly apperciated...

    When you fail to plan, you are planning to fail.

    L 1 Reply Last reply
    0
    • W www Developerof NET

      Hi all, I have created a class library for my application. I have some typed datasets in this class library. While creating the datasets , VS asked me whether to save the connection string in the config file and it created a seperate app.config file in the class library. What i need is that while calling the class library, i should be able to pass in the connection parameters from my applications web.config file and it should not create ant app.config file. How can i do this??? Any help would be kindly apperciated...

      When you fail to plan, you are planning to fail.

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

      Add reference System.Configuration namespace to your class libarary. Use ConfigurationManager.ConnectionStrings["YourConnectionStringNameFromWeb.Config"] in your in the class library. Therefore when this class libarary is called in the asp.net web application, it automatically get the connection string from web.config.

      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