SQL Server/Godaddy/object reference not set

Topics: ASP.NET 2.0
Feb 25, 2008 at 9:56 PM
I got this issue on godaddy where I changed the password on the sql server database - and came up with connection errors afterwards. I added the connection string as instructed by godaddy to update the sql server information (server, db, usrn, pswd) to the web.config file, but still come up with the following error:
______________________________________________________________________________________
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:

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:


NullReferenceException: Object reference not set to an instance of an object.
BlogEngine.Core.Providers.MSSQLBlogProvider.LoadSettings() +143
BlogEngine.Core.Providers.BlogService.LoadSettings() +39
BlogEngine.Core.BlogSettings.Load() +123
BlogEngine.Core.BlogSettings..ctor() +320
BlogEngine.Core.BlogSettings.get_Instance() +61
BlogEngine.Core.Web.HttpModules.CompressionModule.System.Web.IHttpModule.Init(HttpApplication context) +30
System.Web.HttpApplication.InitModulesCommon() +66
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +814
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +243
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +106
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +340

_________________________________________________________________________________________________________

what did I miss?

thanks, Beatrice
Feb 26, 2008 at 4:01 PM
Many thanks to Al Nyveldt, one of the developers here at BlogEning.Net who fixed the connection string in the web.config file.

For all others having problems with godaddy, sql and a downloaded template coming up with the same error, you may want to try adding this connection string:

<connectionStrings>

<add name="BlogEngine" connectionString=" Server=yourserver; Database=yourdatabase; User ID=youruserid; Password=yourpassword; TrustedConnection=False" providerName="System.Data.SqlClient" />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString=" Server=yourserver; Database=yourdatabase; User ID=youruserid; Password=yourpassword; TrustedConnection=False" providerName="System.Data.SqlClient" />

</connectionStrings>

Thanks Al!