locked
Connectionstring RRS feed

  • Question

  • I have a big project in my VS2005.  It has several projects including a DataLogic.
    This datalogic contains a single dataset.

    Everything is running very smoothly on my local 2005 database.

    Now when i publish the complete webapplication to our live server, the connectionstring is compiled wrong into the DLL.
    I can not believe that i have to recompile the compleet application with the correct connectionstring every time i want to publish the application to our live server.  And change it back to the development values.

    What is the best way to solve this issue?
    Should i work with the machine.config? (If yes... How...)

    Kind regards
    Damiaan
    Friday, December 23, 2005 1:07 AM

Answers

  • The solutions was simple.

    I have this webapplication and i want to be able to overwrite the settings of the app.config. 
    The solution is to copy the connectionstring from the app.config to the web.config. 
    The connectionstring from the app.config will be overwritten by the web.config.


    Monday, December 26, 2005 2:48 PM

All replies

  • put the connection string in app.config
    Friday, December 23, 2005 2:25 AM
  • That is the problem.
    The connectionstring exists in the app.config.
    But now because it is in the app.config, i have to change my connectionstring in each datalogic project before i can publish my solution.  After my solutions has been compiled i have to change back all connectionstrings to my development machine. 

    I was searching for a more automated way of working. 

    I know in mean time that there are several solutions.

    1) working with the machine.config, As i have compleet access to my machines this is a possible solution.  But i wouldn't know if it the best solutions
    2) changing the   public Settings()   functions in the settings.settings.cs from my datalogic.
    3) ...

    I was wondering which choose would be the best...
    Friday, December 23, 2005 10:09 AM
  • Is there really no-one who has a comment on this one?
    Sunday, December 25, 2005 9:01 PM
  • Damiaan,

    I think Blair answered your question correctly. You need to put a key to an app.config connectionstring section (.NET 2.0) or Appsettings (.NET 1.1). That way you hardcode the key in your dlls - but the actual connstr is stored in the app.config.

    This would not require you to recompile the entire app before deployment. I don't understand what the issue is - that is a very standard practice.

    Sahil Malik [MVP C#]
    Author: Pro ADO.NET 2.0
    http://www.winsmarts.com

    Monday, December 26, 2005 1:19 AM
  • The solutions was simple.

    I have this webapplication and i want to be able to overwrite the settings of the app.config. 
    The solution is to copy the connectionstring from the app.config to the web.config. 
    The connectionstring from the app.config will be overwritten by the web.config.


    Monday, December 26, 2005 2:48 PM
  • Running OneCare on Windows XP SP2 in 90-Day Trial Period

     

    OnceCare won't open - it simply displays for half a second and then dissappear.  It's icon is in the system tray and the service appears to be running; however, I cannot access the control console.  There is no error message.  Rebooting does nothing.  Fixing .NET does nothing.  Disabling/renabling the service does nothing.  Using the OneCare fix too does nothing.  What is the solution?

    Sunday, July 1, 2007 5:23 PM
  • It may be best to contact support. How to contact support - http://forums.microsoft.com/WindowsOneCare/ShowPost.aspx?PostID=1183038&SiteID=2
    Sunday, July 1, 2007 7:24 PM
  • Reinstalling OneCare should fix the problem. But if you are hesitant, follow Jim's recommendation.
    Sunday, July 1, 2007 7:54 PM