Location of database files

Discussion in 'H-Sphere Shared Hosting' started by KazMax, May 3, 2010.

  1. KazMax

    KazMax Perch

    If I have a database or text file which my ASP.NET application needs to access, but what I need to keep away from prying eyes, usually I would create a directory outside of the web site root and programmatically access the file in that location.

    That didn't seem to work for me, so I have put the database file in the App_Data folder which prevents it being accessed outside of the web site. That's okay, but I would prefer to locate the file in a different location physically outside of the web site. Is this possible?

  2. Stephen

    Stephen US Operations Staff Member

    in asp.net it is locked to the appdir, so no not allowed outside, in app_data will be safe.
  3. KazMax

    KazMax Perch

    I am aware of that. However that is not the real issue.

    On my development PC I have my web projects defined to use Version Control (Microsoft SourceSafe). Unfortunately SourceSafe automatically picks up any files in the project directory and attempts to add them to version control. Every single time this happens I have to remember to de-select the database file in the App_Data folder, otherwise when SourceSafe checks the file in it is set to read-only on the development hard disk, meaning I can't do any debugging on the development PC unless I unlock the file first. All very inconvenient.

    It is not possible to tell SourceSafe to ignore files. You can tell SourceSafe to exclude a file - but it renames the file with a new file extension! That's even worse than having to unlock the file.

    Whilst I could define and access the database file in a different directory on the development PC, I was hoping to keep the file layout the same as for the development PC. Obviously I can't do that, so I am stuck with having to remember to de-select the database file from the App_Data folder each time I check files in.

  4. Stephen

    Stephen US Operations Staff Member

    what about moving to SQL as a long term solution? :)
  5. KazMax

    KazMax Perch

    I work with SQL Server as part of my regular job, so that was my initial preference, and was one of the reasons I stuck with Jodohost when I made a commitment with my hosting plans recently. I have been with Jodohost for several years and IMHO you guys do the hosting job far better than many other companies (I have tried a few over the years!).

    However, I found connecting to Jodohost SQL Server to be rather more difficult than I expected. I couldn't connect using Microsoft Management Studio. It didn't want to know when I tried SQL Maestro. I did (somewhat to my surprise) manage to connect with the free utility advised by your support staff and that might have been okay, but it meant that connectivity from a remote location (for debugging and general development) was questionable.

  6. Stephen

    Stephen US Operations Staff Member

    We can give a workaround for that, it involves a bit extra work on our part via ticket, but we do it pretty regular. We don't like to hand it out like candy because it increases the complexity of our management, but ask nicely and we will do it :)

    BTW it will be a new username for the view enabled user.
  7. KazMax

    KazMax Perch

    Thanks Stephen. I've been pestering your support guys with multiple (minor) issues over the last couple of weeks and I didn't feel that I wanted to give them yet another one about the SQL Server connectivity, when I have an alternative solution to hand.

    Changing from my current solution to SQL Server would be very quick and easy, as I have written the code in object-orientated fashion and just need to change one class to point to a different database.

    However for the time being I will hold off as I am very busy on other things right now.

    I've been a Jodohost customer for several years now, and I seem to recall that at an earlier time I could have a database outside of the web site (I used to use a couple of Access databases and they were kept outside of the web sites). Maybe that's a change that has happened in recent times.

  8. Stephen

    Stephen US Operations Staff Member

    ASP can have it anywhere in the webroot, asp.net is only in the application dir that starts at domain root. :)

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services