Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DotNetNuke Date ProblemDotNetNuke Date Problem
Previous
 
Next
New Post
10/24/2006 10:56 AM
 

I am trying to develop a module for dnn 4.3.5

 

I am using the following tools

VS 2005

SQL Server 2003

 

I am getting the following error after i hooked it up to my stored procedures

 

DotNetNuke.Services.Exceptions.ModuleLoadException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. ---> System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value) at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value) at System.Data.SqlTypes.SqlDateTime..ctor(DateTime value) at System.Data.SqlClient.MetaType.FromDateTime(DateTime dateTime, Byte cb) at System.Data.SqlClient.TdsParser.WriteValue(Object value, MetaType type, Int32 actualLength, Int32 encodingByteSize, Int32 offset, TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, String spName, Object[] parameterValues) at YourCompany.Modules.First.SqlDataProvider.AddFirst(Int32 portalID, Int32 moduleID, String title, String text, DateTime dateAdd, DateTime dateMod) in C:\DotNetNukeDevelop\App_Code\First\SqlDataProvider.vb:line 135 at YourCompany.Modules.First.FirstController.Add(FirstInfo objFirst) in C:\DotNetNukeDevelop\App_Code\First\FirstController.vb:line 28 at YourCompany.Modules.First.EditFirst.cmdUpdate_Click(Object sender, EventArgs e) in C:\DotNetNukeDevelop\DesktopModules\First\EditFirst.ascx.vb:line 150 --- End of inner exception stack trace ---

 

 

I know the problem is that for some odd reason it is not accepting any dates past 12/31/1999.  My question is WHY, and what can I do to fix this

 

 
New Post
10/24/2006 4:34 PM
 
If you take a second look, you'll notice that it's not accepting dates past 12/31/9999, not 12/31/1999.  See if you are trying to send Date.MaxValue/MinValue in your module's cmpUpdate_Click method.

Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
11/3/2006 10:44 AM
 

I use Null.NullDate which is similar to 1-1-1001 etc... why does the DNN DataProvider not make a real Null of them so that the stored procedures do not throw that error? Or is there a way to do this automatically? Programming

if(myDate == Null.NullDate)
{
   spDateValue = null;
}

is quite cumbersome. Any suggestions?

 
New Post
11/3/2006 12:17 PM
 
What I have done, is in my dataProvider, I provide some private methods which transform a value type into a SqlParameter.

Because, even your above example won't work, because spDateValue (if it's a DateTime) is a struct and can't be null.  So you have to check and then create a SqlParameter, setting the Value to DBNull.Value if it is, say, Null.NullDate, or if it is before "1/1/1753 12:00:00 AM", or Nullable<DateTime> without a value.  By the time it gets to actually calling the storedProc, it's pretty much out of DNN's hands, so you'll have to write that code.

Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
11/3/2006 12:41 PM
 
I am using a generated DAL+ data provider. It seems the MS Application blocks does not make Null of a Null.NullDate So the 1/1/1001 00.00.00 value is out of scope as you say. But I thought that the MS application blocks would make a NULL of it. I would rather prefer to use a DateTime? in which I can store a Null value instead of the Null.NullDate which will not get converted. What do you think?
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DotNetNuke Date ProblemDotNetNuke Date Problem


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out