0

How to give the connection string of SQL Compact DB in web.config of ASP.NET application where DB is outside the application folder?

Sunil Aher
  • 747
  • 3
  • 14
  • 34
  • AFAIK You need a full-trust configured IIS server and give rights to that folder to your service account running IIS. A situation not easy to find if you host your site on a thirdy party ISP – Steve Sep 09 '14 at 11:47
  • Will it work if that DB folder is system folder like (Program Files and Windows)? – Sunil Aher Sep 09 '14 at 12:05
  • If I remember well, IIS is installed with Medium Trust, meaning that your app could reach files only in its own root folder and below. It is a big security concern leave your app the permission to read/write file outside its own folder. So I think that it couldn't work. But I am not an expert here. Search for IIS and Medium Trust – Steve Sep 09 '14 at 12:34
  • http://stackoverflow.com/questions/2617454/what-is-medium-trust-in-asp-net – Steve Sep 09 '14 at 12:36
  • [And this article](http://msdn.microsoft.com/en-us/library/ms998341.aspx#paght000020_step1) hints to a way to override the restriction of Medium Trust about the file read/write permissions, but it is still a difficult thing to do on an ISP hosting account – Steve Sep 09 '14 at 12:42

0 Answers0