Server Error in '/' 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:


Line 151:        SqlDataAdapter da = new SqlDataAdapter(strSql, Conn);
Line 152:        DataTable dt = new DataTable();
Line 153:        da.Fill(dt);
Line 154:        Conn.Close();
Line 155:        Conn = null;

Source File: c:\website\WEB_DAI_BIEU_QUOC_HOI\App_Code\dao\clsDatabase.cs    Line: 153

Stack Trace:


[InvalidOperationException: The ConnectionString property has not been initialized.]
   System.Data.SqlClient.SqlConnection.PermissionDemand() +7117013
   System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection) +30
   System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +312
   System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +202
   System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +413
   System.Data.SqlClient.SqlConnection.Open() +128
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +172
   System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +453
   System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +141
   clsDatabase.getDataTable(String strSql) in c:\website\WEB_DAI_BIEU_QUOC_HOI\App_Code\dao\clsDatabase.cs:153
   ASP.print_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\website\WEB_DAI_BIEU_QUOC_HOI\print.aspx:21
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
   System.Web.UI.Page.Render(HtmlTextWriter writer) +39
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8753


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3190.0