tanu80
asked on
Regarding connectionstring as Null in asp.net
Hi I am using n tier archtecture.I have craeted main project fille for client code.I have created class library and used the class libraries in main project for setting the Business rule with add refence in the main project i am calling the class libray dll .I am also using Microsoft Enerprise Library class 4.0 blaock in my application.The application is working fine in localhost but when i am uploading to the server i am getting below error :
The value can not be null or an empty string.
Parameter name: connectionString
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.ArgumentException: The value can not be null or an empty string.
Parameter name: connectionString
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: The value can not be null or an empty string.
Parameter name: connectionString]
Microsoft.Practices.Enterp riseLibrar y.Data.Dat abase..cto r(String connectionString, DbProviderFactory dbProviderFactory) +171
Microsoft.Practices.Enterp riseLibrar y.Data.Sql .SqlDataba se..ctor(S tring connectionString) +43
Libext1.DAL.GetDB.GetAllCo untryData( ) in C:\MyLifeSpaceProject\Libe xt1\Libext 1\DAL\GetD B.cs:155
Libext1.BLL.DBManager.GetC ountryData () in C:\MyLifeSpaceProject\Libe xt1\Libext 1\BLL\DBMa nager.cs:8 1
MyLogin.Registration.BindC ountry() in C:\Documents and Settings\tanayya\Desktop\L ifeSpace\M yLogin\MyL ogin\Regis tration.as px.cs:143
MyLogin.Registration.Page_ Load(Objec t sender, EventArgs e) in C:\Documents and Settings\tanayya\Desktop\L ifeSpace\M yLogin\MyL ogin\Regis tration.as px.cs:63
System.Web.Util.CalliHelpe r.EventArg FunctionCa ller(IntPt r fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEvent HandlerDel egateProxy .Callback( Object sender, EventArgs e) +33
System.Web.UI.Control.OnLo ad(EventAr gs e) +99
System.Web.UI.Control.Load Recursive( ) +47
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +1436
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
and i am also looking help for exception handling , can any one help me out to come out from this type error and most important for exception handling.Sample code, document is well accepted.
The value can not be null or an empty string.
Parameter name: connectionString
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.ArgumentException: The value can not be null or an empty string.
Parameter name: connectionString
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: The value can not be null or an empty string.
Parameter name: connectionString]
Microsoft.Practices.Enterp
Microsoft.Practices.Enterp
Libext1.DAL.GetDB.GetAllCo
Libext1.BLL.DBManager.GetC
MyLogin.Registration.BindC
MyLogin.Registration.Page_
System.Web.Util.CalliHelpe
System.Web.Util.CalliEvent
System.Web.UI.Control.OnLo
System.Web.UI.Control.Load
System.Web.UI.Page.Process
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
and i am also looking help for exception handling , can any one help me out to come out from this type error and most important for exception handling.Sample code, document is well accepted.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i am using the config file as below
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extension s" type="System.Web.Configura tion.Syste mWebExtens ionsSectio nGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35">
<sectionGroup name="scripting" type="System.Web.Configura tion.Scrip tingSectio nGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35">
<section name="scriptResourceHandle r" type="System.Web.Configura tion.Scrip tingScript ResourceHa ndlerSecti on, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" requirePermission="false" allowDefinition="MachineTo Applicatio n"/>
<sectionGroup name="webServices" type="System.Web.Configura tion.Scrip tingWebSer vicesSecti onGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35">
<section name="jsonSerialization" type="System.Web.Configura tion.Scrip tingJsonSe rializatio nSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" requirePermission="false" allowDefinition="Everywher e"/>
<section name="profileService" type="System.Web.Configura tion.Scrip tingProfil eServiceSe ction, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" requirePermission="false" allowDefinition="MachineTo Applicatio n"/>
<section name="authenticationServic e" type="System.Web.Configura tion.Scrip tingAuthen ticationSe rviceSecti on, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" requirePermission="false" allowDefinition="MachineTo Applicatio n"/>
<section name="roleService" type="System.Web.Configura tion.Scrip tingRoleSe rviceSecti on, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" requirePermission="false" allowDefinition="MachineTo Applicatio n"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>
<add key="MyLifeSpaceCommonLibE xtPath" value="C:\MyLifeSpaceProje ct\Common1 ext\Common 1ext\bin\D ebug"/>
<!--<add name="MyLifeConnectionStri ng" value="Data Source=LENOVO-2DB4B5C7\SQL EXPRESS;In itial Catalog=tanaya;Integrated Security=True " SqlClient "/>-->
<add key="siteurl" value="http://www.mylifespace.com/dev/mylifespace/"/>
</appSettings>
<connectionStrings>
<!--<add name = "AsbestosConnectionString" connectionString = " Data Source=LENOVO-2DB4B5C7\SQL EXPRESS;In itial Catalog=tanaya;Integrated Security=True " providerName = " System.Data.SqlClient " />-->
<!--<add name = " LJVWMSCRAMConnectionString " connectionString = " Data Source=CHANDRABHAN\CHANDRA BHAN;Initi al Catalog=Asbestos;User ID=sa;Password=mindmill " providerName = " System.Data.SqlClient " />-->
<!--<add name="MyLifeConnectionStri ng" connectionString="Data Source=MainServer;Initial Catalog=MyLifeSpace;Persis t Security Info=True;User ID=shell;Password=vijay;"/ >-->
<!--<add name="MyLifeConnectionStri ng" connectionString="Data Source=178058-WWW;Initial Catalog=MyLifeSpace;Persis t Security Info=True;User ID=MyLifeSpace;Password=m2 9GvwPh4CV6 5x29JwvBe8 378agD" providerName="System.Data. SqlClient" />-->
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C56193 4E089"/>
<add assembly="System.Data.Data SetExtensi ons, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C56193 4E089"/>
<add assembly="System.Web.Exten sions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C56193 4E089"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<customErrors mode="Off"></customErrors>
<identity impersonate="true"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericEr rorPage.ht m">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm " />
</customErrors>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Exten sions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.W ebControls " assembly="System.Web.Exten sions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Se rvices.Scr iptHandler Factory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Se rvices.Scr iptHandler Factory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers. ScriptReso urceHandle r, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers. ScriptModu le, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSh arpCodePro vider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193 4e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConf iguration= "false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandl er" type="System.Web.Handlers. ScriptModu le, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFac tory-Integ rated"/>
<remove name="ScriptHandlerFactory "/>
<remove name="ScriptHandlerFactory AppService s"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory " verb="*" path="*.asmx" preCondition="integratedMo de" type="System.Web.Script.Se rvices.Scr iptHandler Factory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
<add name="ScriptHandlerFactory AppService s" verb="*" path="*_AppService.axd" preCondition="integratedMo de" type="System.Web.Script.Se rvices.Scr iptHandler Factory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
<add name="ScriptResource" preCondition="integratedMo de" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers. ScriptReso urceHandle r, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD3 64E35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microso ft-com:asm .v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extension s" publicKeyToken="31bf3856ad 364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0. 0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extension s.Design" publicKeyToken="31bf3856ad 364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0. 0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.net>
<mailSettings>
<smtp from="contact@indiatesting .info" deliveryMethod="PickupDire ctoryFromI is">
<network host="." password="" userName=""/>
</smtp>
</mailSettings>
</system.net>
</configuration>
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extension
<sectionGroup name="scripting" type="System.Web.Configura
<section name="scriptResourceHandle
<sectionGroup name="webServices" type="System.Web.Configura
<section name="jsonSerialization" type="System.Web.Configura
<section name="profileService" type="System.Web.Configura
<section name="authenticationServic
<section name="roleService" type="System.Web.Configura
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>
<add key="MyLifeSpaceCommonLibE
<!--<add name="MyLifeConnectionStri
<add key="siteurl" value="http://www.mylifespace.com/dev/mylifespace/"/>
</appSettings>
<connectionStrings>
<!--<add name = "AsbestosConnectionString"
<!--<add name = " LJVWMSCRAMConnectionString
<!--<add name="MyLifeConnectionStri
<!--<add name="MyLifeConnectionStri
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C56193
<add assembly="System.Data.Data
<add assembly="System.Web.Exten
<add assembly="System.Xml.Linq,
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<customErrors mode="Off"></customErrors>
<identity impersonate="true"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericEr
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm
</customErrors>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Exten
<add tagPrefix="asp" namespace="System.Web.UI.W
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Se
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Se
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSh
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConf
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandl
</modules>
<handlers>
<remove name="WebServiceHandlerFac
<remove name="ScriptHandlerFactory
<remove name="ScriptHandlerFactory
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory
<add name="ScriptHandlerFactory
<add name="ScriptResource" preCondition="integratedMo
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microso
<dependentAssembly>
<assemblyIdentity name="System.Web.Extension
<bindingRedirect oldVersion="1.0.0.0-1.1.0.
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extension
<bindingRedirect oldVersion="1.0.0.0-1.1.0.
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.net>
<mailSettings>
<smtp from="contact@indiatesting
<network host="." password="" userName=""/>
</smtp>
</mailSettings>
</system.net>
</configuration>
Can we see it?