-9
بعد ا عملت setup للمشروع تبعى وعملت install له على الpc تبعى ظهرت هذه المشكلة على الرغم من أن الconnection محدد في الweb.config
ويوجد class يستقبل هذا الconnection وأنا أعرف الconnection في الweb config
<appSettings> <add key="CnStr" value="Server=(local);Database=Guest;Trusted_Connection=True;" /> </appSettings>
والclass هذا الكود
Public Sub New()
MyClass.New(ConfigurationSettings.AppSettings("CnStr"))
End Subعلى الرغم من أن البرنامج يعمل جيدا عندما أعمل start or run له
اقتباسServer Error in '/Guest_Book' Application.--------------------------------------------------------------------------------
The ConnectionString property has not been initialized.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.
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:
[invalidOperationException: The ConnectionString property has not been initialized.]
System.Data.SqlClient.SqlConnection.Open() +433
GuestBook.DatabaseClass..ctor(String connStr)
GuestBook.DatabaseClass..ctor()
GuestBook.LoginUC.Button1_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
أتمنى أن أكون قد أوضحت المشكلة
-waf