locked
Multiple Forms - Where should common data be? RRS feed

  • Question

  • Hello all

    I need to know where to place the CONNECTIONSTRING that points to my SQL database and other common variables so both FORMS that I placed in my application will be able to recognize and use it.

    Thanks.


    lioritshiran@gmail.com
    Saturday, November 20, 2010 4:37 PM

Answers

  • Is your second form in same solution as the first? If so, how do you try to recognize it? I think it is accessible via "Properties.Settings.Default.theConnectionString"
    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords
    • Marked as answer by Alan_chen Tuesday, November 30, 2010 2:03 AM
    Saturday, November 20, 2010 5:43 PM

All replies

  • Welcome to the MSDN Forums.

    1. Right click your solution in solution explorer.
    2. Click Properties.
    3. Click Settins from the left pan.
    4. Add your requiered application settings, these will be saved in an XML file named app.config but you can retrieve/modify their values via code, YourNamespace.Properties.Default...

    Regards,

    Yasser


    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords
    Saturday, November 20, 2010 4:46 PM
  • Welcome to the MSDN Forums.

    1. Right click your solution in solution explorer.
    2. Click Properties.
    3. Click Settins from the left pan.
    4. Add your requiered application settings, these will be saved in an XML file named app.config but you can retrieve/modify their values via code, YourNamespace.Properties.Default...

    Regards,

    Yasser


    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords

    Should I change the ACCESS MODIFIER from Internal to Public?

     


    lioritshiran@gmail.com
    Saturday, November 20, 2010 5:02 PM
  • Should I change the ACCESS MODIFIER from Internal to Public?


    lioritshiran@gmail.com


    Usually No, but if you want to export them to outside of the dll/application then Yes.
    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords
    Saturday, November 20, 2010 5:15 PM
  • Should I change the ACCESS MODIFIER from Internal to Public?

     


    lioritshiran@gmail.com

     


    Usually No, but if you want to export them to outside of the dll/application then Yes.
    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords

    I've noticed that the connectionstring is allready there but still my scond form don't recognize it what is wrong?
    lioritshiran@gmail.com
    Saturday, November 20, 2010 5:25 PM
  • Is your second form in same solution as the first? If so, how do you try to recognize it? I think it is accessible via "Properties.Settings.Default.theConnectionString"
    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords
    • Marked as answer by Alan_chen Tuesday, November 30, 2010 2:03 AM
    Saturday, November 20, 2010 5:43 PM