locked
Change the path of my DB in the Web.config before publish it RRS feed

  • Question

  • User-1822150920 posted

    How can I change the path of my Firebird database located into the App_Data folder in the Web.config before publish it in the server?

    I tried using 

    Database=App_Data\Ejemplos.fdb

    and putting the ~\ and ../ before the path of my DB.

    This is my current connection string:

    <add key="ConecctionString" value="User=sysdba;Password=masterkey;Database=C:\BasesDatos\GrupoSAT\Ejemplos.fdb;Datasource=localhost;" />
    <add key="TableName" value="INVE01" />

    I'll appreciate any help.

    Monday, March 2, 2015 4:00 PM

Answers

All replies

  • User-1716253493 posted

    Try change to

    Database=|DataDirectory|Ejemplos.fdb

    Monday, March 2, 2015 7:40 PM
  • User-1822150920 posted

    Could you post an example of the path?

    Monday, March 2, 2015 8:51 PM
  • User-1716253493 posted

    |DataDirectory| will point to App_Data folder inside your application

    The real path depend where the application

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 2, 2015 8:56 PM
  • User-271186128 posted

    Hi ArciGo,

    As for this issue, I agree with Suwandi, for more details about DataDirectory, please refer to this article.

    https://msdn.microsoft.com/en-us/library/vstudio/cc716756(v=vs.100).aspx

    Best Regards,
    Dillion

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 3, 2015 1:32 AM