Yesterday, someone asked me that the web application working fine on localhost but not working on web server. Problem was duplicate entry collection in connection string. When application run under the IIS, parent web.config merge in the web site configuration file and causes the duplicate entry. Simple you have to change the name of connection string or use <clear/> tag before start of connection.
Below is the screen shot you will see on the screen when you are trying to get the configuration with the same name exist on another configuration file.

Here’ is the solution
<connectionStrings>
<clear/>
<add name="LocalSqlServer" providerName="System.Data.SqlClient" connectionString="user id=aspxtutorial; password=xxxx; server=aspxtutorial.com; database=sharepoint;" />
</connectionStrings>
Note: you can also use <remove name="LocalSqlServer"/> tag as well