Dear all
following error occored.
Server Error in '/' Application.
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 23:
Line 24:
Line 25: public static readonly string ConnectionString_Synergy = ConfigurationManager.AppSettings["LocalMySqlServer"].ToString();
Line 26: public static readonly string ConnectionString_Hospital = ConfigurationManager.AppSettings["DefaultConnectionString"].ToString();
Line 27:
Source File: c:\inetpub\vhosts\synergyactiongroup.com\httpdocs\App_Code\CSharp\SQLHelper.cs Line: 25
below is web.config code
="1.0"="UTF-8"
<configuration>
<configSections>
</configSections>
<connectionStrings>
<remove name="LocalMySqlServer" />
<add name="LocalMySqlServer" connectionString=" Data Source=XXXX;Database=synergya_shoes;User ID=synergyaction;Password=XXX" />
<add name="DefaultConnectionString" connectionString="Data Source=XXXXX;Database=synergya_shoes;User ID=synergyshoes12345;Password=XXXX" />
<add name="hospitalConnectionString" connectionString="Data Source=XXXX;Database=synergya_shoes;User ID=synergyshoes12345;Password=XXXX" />
<add name="hospitalConnectionString2" connectionString="Data Source=111.118.213.110;Database=synergya_shoes;User ID=synergyshoes12345;Password=password@1" />
</connectionStrings>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.0">
<codeSubDirectories>
<add directoryName="CSharp"/>
</codeSubDirectories>
<assemblies>
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.ServiceProcess, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Default.aspx" timeout="2880" />
</authentication>
<membership defaultProvider="AspNetKarigariNewSqlMembershipProvider">
<providers>
<clear />
<add name="AspNetKarigariNewSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="DefaultConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="KarigariNew" />
</providers>
</membership>
<profile defaultProvider="AspNetKarigariNewSqlProfileProvider" enabled="true">
<providers>
<clear />
<add name="AspNetKarigariNewSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="DefaultConnectionString" applicationName="KarigariNew" />
</providers>
<properties>
<add name="FirstName" type="system.string" />
<add name="LastName" type="System.string" />
<add name="Gender" type="System.String" />
<add name="DateOfBirth" type="System.DateTime" />
<add name="PhoneNumber" type="System.String" />
<add name="FaxNumber" type="System.String" />
<add name="AlternateEmail" type="System.String" />
<add name="Company" type="System.String" />
<group name="ShippingAddress">
<add name="Address1" type="System.String" />
<add name="Address2" type="System.String" />
<add name="City" type="System.String" />
<add name="State" type="System.String" />
<add name="CountryID" type="System.Int32" />
<add name="ZipPostalCode" type="System.String" />
</group>
<group name="BillingAddress">
<add name="Address1" type="System.String" />
<add name="Address2" type="System.String" />
<add name="City" type="System.String" />
<add name="State" type="System.String" />
<add name="CountryID" type="System.Int32" />
<add name="ZipPostalCode" type="System.String" />
</group>
<group name="Preferences">
<add name="ReceiveEmails" type="System.Boolean" defaultValue="True" />
<add name="SubscribedToNewsletter" type="System.Boolean" defaultValue="True" />
<add name="CurrencyId" type="System.Int32" defaultValue="12" />
</group>
</properties>
</profile>
<roleManager defaultProvider="AspNetKarigariNewSqlRoleProvider" enabled="true">
<providers>
<clear />
<add name="AspNetKarigariNewSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="DefaultConnectionString" applicationName="KarigariNew" />
<add name="AspNetKarigariNewWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="KarigariNew" />
</providers>
</roleManager>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<controls>
</controls>
</pages>
<httpModules>
</httpModules>
</system.web>
<system.net>
</system.net>
<system.webServer>
<modules>
</modules>
<directoryBrowse enabled="true"/>
</system.webServer>
<location path="online">
<system.web>
<trust level="Full" />
</system.web>
</location>
</configuration>