Last post Feb 22, 2009 10:46 PM by Nai-Dong Jin - MSFT
Feb 17, 2009 03:15 AM|bluenile|LINK
My website is facing one problem after hosting to the server.When i execute my code from local(india) all working fine.But when i host it to UK,the error coming "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime
value" . I used Culture=en-GB in web.config.But not solved.
This error is coming to all pages where datetime value is using..
Please help me ..
ASP .net2.0 form validation
asp .net 2.0
AS.NET 2.0 C#
Feb 17, 2009 04:16 AM|santosh_maharaja|LINK
Can you post your code or screenshot showing the error on some code line...
Feb 17, 2009 05:54 AM|bluenile|LINK
this is my stored procedure
create procedure SelectLeaveByDate(@StartDate datetime=null,@EndDate datetime =null)
SELECT [StartDate],[EndDate] FROM [tablename] WHERE [StartDate] BETWEEN @StartDate AND @EndDate OR [EndDate] BETWEEN @StartDate AND @EndDate
and when i execute it using 'exec SelectLeaveByDate '2009-02-13T00:00:00','2009-02-23T00:00:00' ' its working fine.But when i execute it from asp.net using execute query its showing the error incorrect syntax near SelectLeaveByDate ..Please help
Feb 22, 2009 10:46 PM|Nai-Dong Jin - MSFT|LINK
From your description, i think you need to start a profiler to trace your SQLServer executing command first, so that you can see the exact parameters which pass to the stored procedure. If the parameters aren't the same with those one you executed manually,
you may check the datetime format or adjust your stored procedure to make the parameters be compatible with your sp. Another cause is that, you may forget to set CommandType property to stored procedure if you were using SQLCommand object to call that sp.