MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old May 13th, 2004, 05:01 AM
FlashHeart FlashHeart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: UK
Posts: 78 FlashHeart User rank is Lance Corporal (50 - 100 Reputation Level)FlashHeart User rank is Lance Corporal (50 - 100 Reputation Level)FlashHeart User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 h 20 m 27 sec
Reputation Power: 5
DateTime type query

Hi All,

I'm having some problems updating my sql server table from my C# app. The table has a single DateTime column which is updated from the app using the query built using:-

oleDbCommand.CommandText = String.Format("UPDATE _User SET LastLoginDate={'0'}", DateTime.Now);

This query ran fine until today when it started failing saying that the datetime is invalid. The DateTime.Now returns (for me) a date in the format dd/mm/ccyy, for today that's 13/05/2004. The failure suggests that this is in the wrong format so I assume that at some point is believes that this date is in mm/dd/2004 format, for which 13/05/2004 is invalid and so it fails, which would explain why it's worked for the last week.

I'm pretty new to C# and I'm obviously missing some date formating trick somewhere. Could someone help? PLEASE!

Cheers

dex

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > DateTime type query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway