p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 1.0 and 1.1 Basics (http://p2p.wrox.com/forumdisplay.php?f=60)
-   -   Sending Dates to Stored Procedure (http://p2p.wrox.com/showthread.php?t=14775)

pete_m June 29th, 2004 05:42 AM

Sending Dates to Stored Procedure
 
Hi,

I have two text boxes which when submitted sends user input dates to a stored procedure which returns results between those dates.

My problem is that the stored procedure will only work if American format dates are input into the text boxes.

How can I make this work when putting English format dates in the text boxes?

I'm pretty sure its a SQL thing as the stored procedure wont work in Query Analyzer with english dates (unless I run SET DATEFORMAT dmy first) I cant do this when calling the stored procedure from the page though...

this is driving me mad,

any help much much appreciated,

Pete


pete_m June 30th, 2004 06:00 AM

OK,

I formatted it in c# first:

DateTime dtDate =
Convert.ToDateTime(Request.Form["txtBox"].ToString()).Date;

(Thanks Chris)



All times are GMT -4. The time now is 08:58 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.