CoderGuru
03-28-2008, 02:57 AM
Hello,
I have a table adapter that calls for a set of variables. Three of which are smalldatetime variables. My stored procedure that it passes to looks like this:
PROCEDURE [dbo].[Timesheet_Select_All_Paged]
@startRowIndex int,
@maximumRows int,
@project INT,
@company INT,
@user INT,
@service INT,
@date SMALLDATETIME = null,
@rangeStart SMALLDATETIME = null,
@rangeStop SMALLDATETIME = null
AS
BEGIN
As you can see, even my default variables for the last three are null. I do this because it allows me to pass null if I want no range.
Problem is, when I pass nothing for these variables to my dataset I get an SQLDataTime overflow error as pasted below. Can anyone please tell me how I can pass a null variable to this table adapter? I am using VB.net BTW, reason I used Nothing.
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
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.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
I have a table adapter that calls for a set of variables. Three of which are smalldatetime variables. My stored procedure that it passes to looks like this:
PROCEDURE [dbo].[Timesheet_Select_All_Paged]
@startRowIndex int,
@maximumRows int,
@project INT,
@company INT,
@user INT,
@service INT,
@date SMALLDATETIME = null,
@rangeStart SMALLDATETIME = null,
@rangeStop SMALLDATETIME = null
AS
BEGIN
As you can see, even my default variables for the last three are null. I do this because it allows me to pass null if I want no range.
Problem is, when I pass nothing for these variables to my dataset I get an SQLDataTime overflow error as pasted below. Can anyone please tell me how I can pass a null variable to this table adapter? I am using VB.net BTW, reason I used Nothing.
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
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.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.