Posted by: vnchopra - Friday, 12 September 2008 21:54:11
Hi!
I have been trying for quite some time now to solve my problem. I am unsure if there is a fault with my database or if there is something wrong with the code or my connection string. On my local system, the YAF website works perfectly.
This is the error that i get
[color=darkblue]
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 106: this.Controls.AddAt( 0, _header );
Line 107:[color=red]
[color=red]Line 108: this.Controls.Add( forumControl );[/color][/color]
Line 109:
Line 110: // add the footer control after the page...
Source File: D:\inetpub\pwnconclave\App_Code\YAF\Forum.cs Line: 108
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
YAF.Classes.Config.get_ConnectionString() in Config.cs:94
YAF.Classes.Data.YafDBConnManager.InitConnection() in DBAccess.cs:50
YAF.Classes.Data.YafDBConnManager..ctor() in DBAccess.cs:41
YAF.Classes.Base.ForumPage.InitDB() in ForumPage.cs:298
YAF.Classes.Base.ForumPage.ForumPage_Init(Object sender, EventArgs e) in ForumPage.cs:177
System.Web.UI.Control.OnInit(EventArgs e) +99
System.Web.UI.UserControl.OnInit(EventArgs e) +74
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Control.AddedControl(Control control, Int32 index) +221
System.Web.UI.ControlCollection.Add(Control child) +146
YAF.Forum.Forum_Load(Object sender, EventArgs e) in D:\inetpub\pwnconclave\App_Code\YAF\Forum.cs:108
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434 [/color]
I have no idea why it would be causing a null reference error, am i doing something wrong when it comes to uploading the website? I am using VS 2008 to do my editing and uploading through the VS 2008 ftp. The whole website builds successfully with no errors. You can check it out at www.pwnconclave.com
Can someone please help me?
Posted by: test2005 - Saturday, 13 September 2008 02:12:13
I'd start by getting the "recommended" connection string settings from your ISP. In the mean time, post your string here, maybe we can spot something.
Posted by: vnchopra - Saturday, 13 September 2008 20:33:53
ok i will place the connection string here on my next post, i was wondering, does that particular line of code "Line 108: this.Controls.Add( forumControl );" call the database?
Posted by: vnchopra - Sunday, 14 September 2008 20:12:34
Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
That was taken off connectionstrings.com