Alright, so I’m pretty new to ASP (first day) and I ran into the issue “connection name ‘aspConnectionString’ was not found” or is empty. Let’s fix that too
Locate Your Web.Config
1. Step First of all, we are going to locate the file that includes your connectionstring tags
2. Step The file web.config should be located somewhere in your root dir where your site/app is located
3. Step Open it with the notepad editor
4. Step If you have a good Web.config you will see some samples at the end, but first let’s comment out the empty connectionstring – remove the connectionStrings tags
5. Step Next, change the Initial Catalog and Data Source settings along with your username and password – Examples below
SQL 2005 Connection Strings Example
<connectionStrings>
<add name="WebService.Properties.Settings.ConnectionString"
connectionString="Provider=sqloledb;Data Source=.;Initial Catalog=abc;User Id=user;Password=pass;"
providerName="System.Data.OleDb" />
<add name="SvcLib.Properties.Settings.ConnectionString"
connectionString="Provider=sqloledb;Data Source=.;Initial Catalog=abc;User Id=user;Password=pass;"
providerName="System.Data.OleDb" />
SQL 2000 Connection Strings Example
<connectionStrings>
<add name="WebService.Properties.Settings.ConnectionString"
connectionString="Provider=sqloledb;Data Source=YOUR_SERVER;Initial Catalog=abc;User Id=user;Password=pass;"
providerName="System.Data.OleDb" />
<add name="SvcLib.Properties.Settings.ConnectionString"
connectionString="Provider=sqloledb;Data Source=YOUR_SERVER;Initial Catalog=abc;User Id=user;Password=pass;"
providerName="System.Data.OleDb" />
<add name="aspConnectionString" connectionString="Data Source=YOUR_SERVER;Initial Catalog=abc;User Id=user;Password=pass;"
providerName="System.Data.SqlClient" />
</connectionStrings>
Explanations
From what I've learnt so far, you need to replace the following options to establish the connection with your database and you're done:
YOUR_SERVER with localhost
Initial Catalog with your InstanceName
user and password are obvious - note: Dont enter Windows authentication here, enter the SQL authentication here (mixed!!!)