Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 21st, 2006, 07:45 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default date in sql server and in visual studio

i have come across some very strange beheaviour using date in sql server and VS.
i am using date as follow: DD/MM/YYYY, this get accepted by the sqlserver when you input this date from a VS form. however, when you pass some date to the sql (for example to compare to dates) it considers as MM/DD/YYYY. i don't know what's happening.

all my settings in the system is set to DD/MM/YYYY.

is there any way that you can set to make both sides understand one format

anyone can help please?

  #2 (permalink)  
Old March 22nd, 2006, 03:20 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

The sql server date format is dd/mm/yyyy?

  #3 (permalink)  
Old March 22nd, 2006, 04:23 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So why when i pass a parameter as DD/MM/YYYY to the SQL, it considers it as MM/DD/YYYY. do you know anywhere where i can go and change the setting. i have sql server 2005 express edition.

thanks:)

  #4 (permalink)  
Old March 22nd, 2006, 05:02 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Sql server determines the date format based on the collation selected when the server was set up. In your case it sees dates as mm/dd/yyyy. Before you run a query you will need to use SET DATEFORMAT. Look it up in books on line

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio Development Server Earl Hickey .NET Framework 2.0 1 February 7th, 2008 06:02 PM
installing sql server 2005 with visual studio lucycastaldo SQL Server 2005 2 April 23rd, 2007 06:46 PM
Visual Studio 2005 App_Data DB to SQL Chuck_aa ASP.NET 2.0 Basics 5 August 30th, 2006 07:10 PM
Visual studio.Net, IIS, and sql server anthonyij VS.NET 2002/2003 2 May 26th, 2006 04:37 AM
Visual Studio 2002 server explorer and toolbox iss songsan General .NET 0 December 21st, 2004 03:56 PM



All times are GMT -4. The time now is 07:35 PM.


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