部署到服务器时会出现 ConnectionString 属性尚未初始化。 的错误
“/rep”应用程序中的服务器错误。--------------------------------------------------------------------------------
ConnectionString 属性尚未初始化。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.InvalidOperationException: ConnectionString 属性尚未初始化。
源错误:
执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[InvalidOperationException: ConnectionString 属性尚未初始化。]
System.Data.SqlClient.SqlConnection.PermissionDemand() +4876643
System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection) +20
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
Sqlhelper.Excutescalar1(String sql) +42
Login.getlogin(String name, String mm) +117
Login.btnlogin_Click(Object sender, ImageClickEventArgs e) +228
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
--------------------编程问答-------------------- 已经很明显告诉你问题了。ConnectionString 属性尚未初始化. --------------------编程问答-------------------- --------------------编程问答-------------------- 在vs中调试是没有问题的 --------------------编程问答--------------------
在vs中可以正常的运行
--------------------编程问答-------------------- webconfig里面加上.
--------------------编程问答-------------------- 已经有了 不是说了 在vs里调式没有问题
<configuration>
<connectionStrings>
<add name="SqlServer" connectionString="Data Source=(local);Initial Catalog=xxx;User ID=xx;passWord=xx"/>
</connectionStrings>
</configuration>
补充:.NET技术 , 非技术区