我有一个ASP.NET 4.0网站托管在GoDaddy上有一个数据库。我的网站不会出现。我认为这是我的数据库连接 -ASP.NET网站故障 - DataAccessLayer引发异常
我的连接字符串 -
<connectionStrings>
<add name="Personal" connectionString=" Server=xyz.com; Database=xyzDb; User ID=xyzUser; Password=xyzPass; Trusted_Connection=false" providerName="System.Data.SqlClient" />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString=" Server=abc.com; Database=abcDb; User ID=abcUser; Password=abcPass; Trusted_Connection=false" providerName="System.Data.SqlClient" />
</connectionStrings>
从我的页面中的错误 -
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] FonyFacts02.DataAccessLayer..ctor() +74
FonyFacts02.DataAccessLayer..cctor() +39[TypeInitializationException: The type initializer for 'FonyFacts02.DataAccessLayer' threw an exception.]
FonyFacts02.DataAccessLayer.GetInstance() +0
FonyFacts02.FonyFacts..ctor() +34
FonyFacts02.Default.Page_Load(Object sender, EventArgs e) +99
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
谁能告诉我,如果它实际上是我的连接字符串或其他什么东西? 该网站位于 - http://www.fonyfacts.com/ 谢谢
不要在网上泄露了你的数据库信息 - 垫这些属性与虚拟人物。 – IrishChieftain
只是调试你的代码,并告诉我们究竟在哪里造成的错误 – FosterZ
感谢您的意见! –