CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.dotnetnuke.custom_modules Tags:
Item Type: NewsGroup Date Entered: 5/20/2005 7:49:40 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 21 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
davidparker
Asp.Net User
SqlDateTime overflow. Need help on how to use GetNull()5/20/2005 7:49:40 PM

0/0

Okay, I'm a beginner  and I need some help. I'm getting a 

"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM" error.

I'm providing the lines of code that the error points to. From what I can gather from searching this forum, I need to use GetNull().

The field in question is createdDate

In the db createdDate has a data type of DateTime

-------------this is in my SQLdataprovider.vb

Public Overrides Sub UpdateCymbalX(ByVal itemID As Integer, ByVal moduleID As Integer, ByVal name As String, ByVal description As String, ByVal createdDate As DateTime) SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "dpCymbalXUpdate", itemID, moduleID, name, description, createdDate))  End Sub

------------this is in my Dataprovider.vb

Public MustOverride Sub UpdateCymbalX(ByVal itemID As Integer, ByVal moduleID As Integer, ByVal name As String, ByVal description As String, ByVal createdDate As DateTime)

-------------this is in my CymXBLL.vb

Public Sub Update(ByVal objCymbalX As CymbalXInfo)

DataProvider.Instance().UpdateCymbalX(objCymbalX.itemID, objCymbalX.ModuleID, objCymbalX.name, objCymbalX.description, objCymbalX.createdDate)

End Sub

 

 

dnnstuff
Asp.Net User
Re: SqlDateTime overflow. Need help on how to use GetNull()5/21/2005 10:10:21 PM

0/0

David,

You should just need it in your SqlDataProvider call.

Public Overrides Sub UpdateCymbalX(ByVal itemID As Integer, ByVal moduleID As Integer, ByVal name As String, ByVal description As String, ByVal createdDate As DateTime) SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & "dpCymbalXUpdate", itemID, moduleID, name, description, GetNull(createdDate)))  End Sub

Also, when you are reading your data in and filling in the date into a textbox or something like that, do a test for null with IsNull before setting it. Something like:

If Not IsNull(info.CreatedDate) then
    txtCreatedDate.Text = info.CreatedDate
End If




Richard Edwards
Available DotNetNuke modules - SQLView, CSSInclude, Aggregator - Tabbed Modules, Module Rotator
http://www.dnnstuff.com,
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
SqlDateTime overflow. Need help on how to use GetNull() - ASP.NET ... SqlDateTime overflow. Need help on how to use GetNull(). Last post 05-21-2005 6: 10 PM by dnnstuff. 1 replies. Sort Posts: ...
Cast from DBNull to type Date is not vaild - ASP.NET Forums GetNull = System.DBNull.Value to GetNull = Nothing ... I tried setting GetNull = Nothing and get; SqlDateTime overflow. ...
SqlDateTime overflow. Need help on how to use GetNull() - ASP.NET ... SqlDateTime overflow. Need help on how to use GetNull(). Last post 05-21-2005 6: 10 PM by dnnstuff. 1 replies. Sort Posts: ...
Cast from DBNull to type Date is not vaild - ASP.NET Forums GetNull = System.DBNull.Value to GetNull = Nothing ... I tried setting GetNull = Nothing and get; SqlDateTime overflow. ...
SqlDateTime overflow. Need help on how to use GetNull() - ASP.NET ... SqlDateTime overflow. Need help on how to use GetNull(). Last post 05-21-2005 6: 10 PM by dnnstuff. 1 replies. Sort Posts: ...
Cast from DBNull to type Date is not vaild - ASP.NET Forums GetNull = System.DBNull.Value to GetNull = Nothing ... I tried setting GetNull = Nothing and get; SqlDateTime overflow. ...
SqlDateTime overflow. Need help on how to use GetNull() - ASP.NET ... SqlDateTime overflow. Need help on how to use GetNull(). Last post 05-21-2005 6: 10 PM by dnnstuff. 1 replies. Sort Posts: ...
Cast from DBNull to type Date is not vaild - ASP.NET Forums GetNull = System.DBNull.Value to GetNull = Nothing ... I tried setting GetNull = Nothing and get; SqlDateTime overflow. ...
SqlDateTime overflow. Need help on how to use GetNull() - ASP.NET ... SqlDateTime overflow. Need help on how to use GetNull(). Last post 05-21-2005 6: 10 PM by dnnstuff. 1 replies. Sort Posts: ...
Cast from DBNull to type Date is not vaild - ASP.NET Forums GetNull = System.DBNull.Value to GetNull = Nothing ... I tried setting GetNull = Nothing and get; SqlDateTime overflow. ...




Search This Site:










currency formatting

trying to login from diffirent "branded" sub-directories

decompiling dlls and obfuscation

building a content management site

downloading files with the documents module

controltopaginate was not set to an invalid value:"datalist1"

inheritance issues (c#)

sizeof

free new module: reviews

security/user roles issue

listbox not detecting multiple selected values

enterprise library configuration block error

dynamic page title

looking for shopping cart advice

dotnetnuke newby

how to create reusable code for a few similiar projects

seperatorimageurl not supported on cssfriendly menu

'script' errors when logged in as 'admin' user...help please

multiple documnet printing from asp.net

database connection

error: index was out of range

any idea of how to use membership provider in my case?

icon

duplicate site

webpartcatalogs

please help !!!!!!!!

treeview refresh/load doesnt work correctly after response.writefile

how to tell if a tab is selected in a tabstrip

how to change browser favorite icon

change master page control's value from a vb class in app_code

 
All Times Are GMT