Click here to Skip to main content
15,905,682 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
my application in localhost running successfully but whenever am running on server after hosting am getting the fallowing error plz help me..thank you in advance .
<br />
Server Error in '/' Application.<br />
The connection name 'ConnectionString' was not found in the applications configuration or the connection string is empty.

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 connection name 'ConnectionString' was not found in the applications configuration or the connection string is empty.

Source Error:


Line 9: Testimonials :


Line 10:
Line 11: <asp:DataList ID="DataList1" runat="server"
Line 12: onselectedindexchanged="DataList1_SelectedIndexChanged1" ConnectionString="<%$ ConnectionStrings:ConnectionString %>">
Line 13:

Source File: \\fs8-n01\stor11wc2dfw1\450429\592629\www.4i-solutions.com\web\content\Testimonials2.aspx Line: 11

Stack Trace:


[InvalidOperationException: The connection name 'ConnectionString' was not found in the applications configuration or the connection string is empty.]
System.Web.Compilation.ConnectionStringsExpressionBuilder.GetConnectionString(String connectionStringName) +2471546
ASP.testimonials2_aspx.__BuildControlDataList1() in \\fs8-n01\stor11wc2dfw1\450429\592629\www.4i-solutions.com\web\content\Testimonials2.aspx:11
ASP.testimonials2_aspx.__BuildControlContent2(Control __ctrl) in \\fs8-n01\stor11wc2dfw1\450429\592629\www.4i-solutions.com\web\content\Testimonials2.aspx:5
System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12
ASP._4isolutions_master.__BuildControlContentPlaceHolder1() in \\fs8-n01\stor11wc2dfw1\450429\592629\www.4i-solutions.com\web\content\4isolutions.master:49
ASP._4isolutions_master.__BuildControlform1() in \\fs8-n01\stor11wc2dfw1\450429\592629\www.4i-solutions.com\web\content\4isolutions.master:16
ASP._4isolutions_master.__BuildControlTree(_4isolutions_master __ctrl) in \\fs8-n01\stor11wc2dfw1\450429\592629\www.4i-solutions.com\web\content\4isolutions.master:1
ASP._4isolutions_master.FrameworkInitialize() in \\fs8-n01\stor11wc2dfw1\450429\592629\www.4i-solutions.com\web\content\4isolutions.master.cs:912308
System.Web.UI.UserControl.InitializeAsUserControlInternal() +35
System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8673087
System.Web.UI.Page.get_Master() +51
System.Web.UI.Page.ApplyMasterPage() +15
System.Web.UI.Page.PerformPreInit() +45
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282

Version Information: Microsoft .NET Framework Version:2.0.50727.4961; ASP.NET Version:2.0.50727.4955
Posted
Updated 28-Nov-11 19:29pm
v3
Comments
D K N T H 29-Nov-11 1:25am    
are you using iis7?

Check your web.config that can be found in website/application library on your web server.
 
Share this answer
 
Comments
sreedharmasula 29-Nov-11 1:32am    
i hav been added connectionstring still am getting the error
<connectionstrings>
<clear>
<remove name="LocalSqlServer">

<add name="4i-solutions" connectionstring="Data Source=mssql0818.wc2\inst2;Initial Catalog=450429_4isolution;Integrated Security=False; User ID=450429_4isolution; Password=solut@123A"
="" providername="System.Data.SqlClient">
You have not added connection string TAG in in your WEB.CONFIG
XML
<connectionStrings>
<add name="ConnectionString" connectionstring="Data Source=DBServerName;Integrated Security=false;Initial Catalog=DBName;User ID=DBLogin;Password=DBPassword" providername="System.Data.SqlClient" />   
 
Share this answer
 
v2
Comments
sreedharmasula 29-Nov-11 1:32am    
i hav been added connectionstring still am getting the error
<connectionstrings>
<clear>
<remove name="LocalSqlServer">

<add name="4i-solutions" connectionstring="Data Source=mssql0818.wc2\inst2;Initial Catalog=450429_4isolution;Integrated Security=False; User ID=450429_4isolution; Password=solut@123A"
="" providername="System.Data.SqlClient">
koolprasad2003 29-Nov-11 1:56am    
Have you checked your connectionstring Name is "ConnectionString".
There might be chane of 'SPACE' in <asp:DataList> ConnectionString attribute.
check it.
Check ur Webconfig file.
C#
<connectionstrings>
    <add name="ConnectionString" connectionstring="Data Source=ACC;Initial Catalog=TestProject;Persist Security Info=true; User Id=sa;Password=sa;" providername="System.Data.SqlClient" />
</connectionstrings>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900