Created By
DMG Development
As Seen On

Main Page  |  Forums  |  Register  |  Active Topics  |  Members  |  Search

 
Username:
Password:
DMG Forums >> DMG Forums Discussion >> General Discussion >> Conversion from type 'DBNull' to type 'Date' is not valid
Conversion from type 'DBNull' to type 'Date' is not valid
Author Topic
biddergirl


Newbie

Join Date: 5/7/2009
Posts: 1

Posted: 5/8/2009 2:00:17 AM

Got a mysql database and getting an error about date being null

is there any way to clear forum posts when I can get into forum

grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 5/8/2009 7:19:41 AM

I'm assuming you meant "when I *can't" get into the forum rather than "can". If so, you can always delete rows directly from the DMG_TOPICS or DMG_REPLIES tables if you need to get rid of problem entries.

I'm kind of curious as to how you ended up with a NULL date field.
ellarr


Newbie

Join Date: 5/15/2009
Posts: 4

Posted: 5/20/2009 4:29:08 PM

Interesting. It's happened to me, too. I'll check the database. I'm using MySQL, like biddergirl.

ellarr


Newbie

Join Date: 5/15/2009
Posts: 4

Posted: 5/20/2009 4:32:31 PM

Hm. I can't see anything that doesn't belong in either table, nor anything that does belong but isn't there. Strange.

ellarr


Newbie

Join Date: 5/15/2009
Posts: 4

Posted: 5/20/2009 4:37:06 PM

Here's the verbose description:

[InvalidCastException: Conversion from type 'DBNull' to type 'Date' is not valid.]
Microsoft.VisualBasic.CompilerServices.Conversions.ToDate(Object Value) +457895
DMGForums.Global.Functions.LastTopicBy(Object theuserid, Object theusername, Object thedate) +103
ASP.default_aspx.__DataBind__control18(Object sender, EventArgs e) +205
System.Web.UI.Control.OnDataBinding(EventArgs e) +99
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +124
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
System.Web.UI.WebControls.Repeater.DataBind() +75
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +124
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
System.Web.UI.WebControls.Repeater.DataBind() +75
DMGForums.DefaultPage.DisplayForums() +1292
DMGForums.DefaultPage.Page_Load(Object sender, EventArgs e) +259
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


ellarr


Newbie

Join Date: 5/15/2009
Posts: 4

Posted: 5/21/2009 7:08:54 AM

Ah. All I had to do was select the Repair Forum Counts option from the Admin menu.
grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 5/22/2009 10:13:29 AM

I'm wondering if this is happening in MySQL when there is only one post in a forum and that post is deleted. It could be erroring out when the homepage tries to display that "last by by" with a date.

I'll check it out and try to re-create, but in any case, the repair forum counts function should fix the tables for you.

Good catch.
empkey2


Intermediate

Join Date: 2/20/2008
Posts: 74

Posted: 5/23/2009 2:27:55 AM

We once discussed about this issue. It is because of mySql date format. Please check my old posts.




Kreddy


Beginner

Join Date: 11/11/2009
Posts: 11

Posted: 11/25/2009 4:12:00 AM

Quote:
Quoted From ellarr:

Ah. All I had to do was select the Repair Forum Counts option from the Admin menu.


Dear sir

my forum default page also not landing

because it says Dbnull to date is not valid

Check it on www.forum.sriharshedu.org/default.aspx
give me a good suggetion

Thanks in Advance

Kreddy

Kreddy
grimmeissen


Administrator


Join Date: 8/30/2005
Posts: 656
Location: Cincinnati, Ohio

Posted: 11/30/2009 8:38:16 PM

Have you tried running the repair forum counts function? Try going directly to admin.aspx and then running that. It should fix your home page.

If not, send us the detailed error message you are getting when trying to go to the default page.

  Copyright DMG Development DMG Forums 3.2