Global connection string in vb.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bharathi228
    New Member
    • Jul 2008
    • 28

    Global connection string in vb.net

    Hi, iam doing a windows application

    i have 4 modules.

    3 are class libraries

    in the 4th module iam adding these 3 dlls and execute this

    but i want to put connection string property for this globally.

    so how to write code in app.config

    and how to use this in my class libraries

    i want to know that app.config for storing connectionstrin g can be used with ClassLibraries or not

    please any one help me with this
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    OK, this is how to do what you want:
    Go to the Project menu, in the top toolbar strip. It should be File, Edit, View, Project, etc...

    The last item in the Project dropdown should be "ProjectName Properties." Select it.

    You should get a properties page. Down the left are tabs. Select the "Settings" tab, and you should get a grid. Add your value to the grid. Give it a name, and make it type String, and the Scope should be "Applicatio n."

    To access these values from code, use:
    Code:
    My.Settings.[i]valueName[/i]

    Comment

    Working...