' /'中的服务器错误应用

时间:2013-04-18 18:11:44

标签: asp.net visual-studio-2010 c#-4.0 web-config web-deployment

从堆栈溢出和其他论坛中搜索我的问题的答案后,我将自己问一下,可能有人可以指导我并使用asp.net编程轻松一点。

我遇到了将我的实时网站的值保存到数据库的问题,但有时我都会收到错误。

描述:服务器上发生了应用程序错误。此应用程序的当前自定义错误设置可防止远程查看应用程序错误的详细信息(出于安全原因)。但是,它可以在本地服务器计算机上运行的浏览器中查看。

详细信息:要在远程计算机上查看此特定错误消息的详细信息,请在位于当前Web应用程序根目录中的“web.config”配置文件中创建标记。然后,此标记应将其“mode”属性设置为“Off”。

我试图通过在我的web.config中输入mode = off来查看它,但我无法查看错误的详细信息。

这是我的web.config

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>

    <system.web>
      <customErrors mode="Off"/>
      <compilation debug="true"/>
      <authentication mode="None"/>
    </system.web>
  <location allowOverride="true">
    <appSettings>

      <add key="#" value="Password=#;Persist Security Info=True;User ID=#;Initial Catalog=#;Data Source=#"/>

    </appSettings>
  </location>
</configuration>

我使用我的项目的本地解决方案在我的实时数据库上测试了我的数据库和连接字符串,但是当我尝试使用我的实时服务器测试它时,我无法使用arvixe。

我的同事建议我使用

<connectionStrings>
    <add name="#" connectionString="Data Source=#;Initial Catalog=#;Integrated Security=True" providerName="System.Data.SqlClient"/>    
  </connectionStrings>

但它不适用于实时服务器。 我正在使用连接字符串的应用程序设置,我对它很有信心,因为它与我的本地和实时数据库一起工作正常。

我请求开发人员测试我的online quran reading页面并尝试弄明白。

1 个答案:

答案 0 :(得分:1)

如果您使用的是Sql Express,请尝试使用此连接字符串

Data Source=.\SQLEXPRESS;DataBase=DBName;User ID=abcd;Password=xxxx;

据我所知Integrated Security=True适用于windows authentication。如果您要使用此选项,请将<authentication mode="None"/>更改为<authentication mode="Windows"/>

如果您使用的是Sql Server,可以尝试以下连接字符串

标准连接字符串

Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;

受信任的连接

Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;