Last post Mar 04, 2016 05:32 PM by comego
Feb 26, 2016 06:58 PM|comego|LINK
When running from VisualStudio, the page display correctly, but viewing from iis, it gives error because connecting to sqlexpress failed. What causes that and how to fix it?
Feb 26, 2016 07:33 PM|egor598|LINK
IIS runs your app under different user account.
There's an article on how to configure it: http://www.iis.net/learn/manage/configuring-security/application-pool-identities-and-sql-server-express
Mar 01, 2016 04:39 AM|wmec|LINK
Try to put this
<add name="conn2" connectionString="Data Source=192.168.?.?\your_db_instance;Initial Catalog=your_db_schema;Integrated Security=False;User ID=your_db_login;Password=??????" providerName="System.Data.SqlClient"/>
within Web.config/app.config file in your project, to ensure the project will work fine with the database.
Mar 04, 2016 05:32 PM|comego|LINK
Thanks to all who replied.
It turned out I need to install sql express first. One of the answer says, in IIS a different user is used to access sqlexpress database. That is right. But without sqlexpress engine, nothing would work. After installation, configure the Application Pool
to use NerworkService account to access the database. Everything is working now.