title: The ConnectionString property has not been initialized IIS 8.5
body: <p>I have inherited a website from a friend to host as he fell out with the current person hosting it for him.</p>
  
  <p>Its an old site, was hosted is IIS7 by looks of things and i cant get it online.</p>
  
  <p>Im on a server 2012r2 box with IIS</p>
  
  <p>Basically this is the error i get:</p>
  
  <pre><code>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 95: 
  Line 96:             conOleDbConnection = New SqlConnection(ConfigurationManager.ConnectionStrings.Item("SQLClient").ConnectionString)
  Line 97:             conOleDbConnection.Open()
  Line 98: 
  Line 99:             dadOleDbDataAdapter = New SqlDataAdapter(strSQL, conOleDbConnection)
  
  
  Source File: C:\inetpub\wwwroot\abc\App_Code\SqlClient.vb    Line: 97
  
  Stack Trace:
  
  [InvalidOperationException: The ConnectionString property has not been initialized.]
     System.Data.SqlClient.SqlConnection.PermissionDemand() +7116997
     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
     BBS.SqlClient.DataHandler.GetDataTable(String strSQL) in C:\inetpub\wwwroot\abc\App_Code\SqlClient.vb:97
     BBS.SqlClient.DataHandler.GetDataRow(String strSQL) in C:\inetpub\wwwroot\abc\App_Code\SqlClient.vb:128
     BBS.Sql.AbstractEntity.LoadObjectByCol(String strColumnName, String strColumnValue) in C:\inetpub\wwwroot\abc\App_Code\AbstractEntity.vb:216
     _Default.Bind(String strWebPageURL) in C:\inetpub\wwwroot\abc\Default.aspx.vb:9
     _Default.Page_Load(Object s, EventArgs e) in C:\inetpub\wwwroot\abc\Default.aspx.vb:30
     System.Web.UI.Control.OnLoad(EventArgs e) +106
     System.Web.UI.Control.LoadRecursive() +68
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785
  </code></pre>
  
  <p>So here are the relevant sections of the stack trace files:</p>
  
  <p>SQLCLIENT.VB line 97</p>
  
  <pre><code>Public Shared Function GetDataTable(ByVal strSQL As String) As DataTable
  Dim conOleDbConnection As SqlConnection
  Dim dadOleDbDataAdapter As SqlDataAdapter
  Dim dstDataSet As New DataSet
  
  conOleDbConnection = New SqlConnection(ConfigurationManager.ConnectionStrings.Item("SQLClient").ConnectionString)
  conOleDbConnection.Open()
  
  dadOleDbDataAdapter = New SqlDataAdapter(strSQL, conOleDbConnection)
  dadOleDbDataAdapter.Fill(dstDataSet, "Data")
  
  conOleDbConnection.Close()
  conOleDbConnection = Nothing
  
  Return dstDataSet.Tables("Data")
  End Function
  </code></pre>
  
  <p>SQLCLIENT.VB Line 128</p>
  
  <pre><code>Public Shared Function GetDataRow(ByVal strSQL As String) As DataRow
  Dim dtblGetDataRow As DataTable = GetDataTable(strSQL)
  
  If dtblGetDataRow.Rows.Count = 1 Then Return dtblGetDataRow.Rows(0) Else Return Nothing
  End Function
  </code></pre>
  
  <p>Here is the connection string from the web.config been supplied</p>
  
  <pre><code>&lt;connectionStrings&gt;
  &lt;add connectionString="" name="SQLClient" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>have put the database onto an MSSQL server</p>
  
  <p>try adding in a new connection string:</p>
  
  <pre><code>&lt;add name="MSSQL" connectionString="Data Source=abc;Initial Catalog=def Name;User id=geh;Password=ijk;Persist Security Info=true;Pooling=true" providerName="System.Data.SqlClient"/&gt;
  </code></pre>
  
  <p>But then it erros with all kinds.</p>
  
  <p>Can anybody help me get this website back online please?</p>
  
  <p>Thanks in advance</p>