Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / April 2005

Tip: Looking for answers? Try searching our database.

Convert GetSQLDateTime to formatted date to show on a Windows Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy A38 - 28 Apr 2005 13:08 GMT
I am retrieving data using ADO.Net (from SQL Server) as shown below:

DOB.Text = MyDataReader.GetSqlDateTime(18).ToString

This works fine, but I want to display this on the form formatted as "dd MMM
yyyy" rather than the way it shows now ("dd/mm/yyyy hh:nn").

How can I do this?
Signature

Andy, MCDBA

Katy King - 29 Apr 2005 19:35 GMT
From: "=?Utf-8?B?QW5keSBBMzg=?=" <AndyA38@discussions.microsoft.com>

| I am retrieving data using ADO.Net (from SQL Server) as shown below:
|
[quoted text clipped - 4 lines]
|
| How can I do this?

DateTime allows you to specify the string format.  It looks like
SqlDateTime does not?
If you convert to DateTime first you can do this.

DOB.Text = MyDataReader.GetSqlDateTime(18).Value.ToString("dd MMM yyyy")

There may be a better way as well.

Katy

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.