Click here to Skip to main content
15,927,907 members
Home / Discussions / Database
   

Database

 
QuestionNew at ADO.NET Editing Data Pin
Blekk4-Jan-07 8:00
Blekk4-Jan-07 8:00 
QuestionTable permissions Pin
VK-Cadec4-Jan-07 1:49
VK-Cadec4-Jan-07 1:49 
AnswerRe: Table permissions Pin
VK-Cadec4-Jan-07 3:29
VK-Cadec4-Jan-07 3:29 
QuestionHow to know Store procedure Input and OutPut Parameters through programs Pin
indiaone3-Jan-07 20:05
indiaone3-Jan-07 20:05 
AnswerRe: How to know Store procedure Input and OutPut Parameters through programs Pin
Colin Angus Mackay3-Jan-07 22:59
Colin Angus Mackay3-Jan-07 22:59 
QuestionDate Format Pin
Jay_se3-Jan-07 19:12
Jay_se3-Jan-07 19:12 
AnswerRe: Date Format Pin
nagendra rao s.v.3-Jan-07 19:52
nagendra rao s.v.3-Jan-07 19:52 
AnswerRe: Date Format Pin
Colin Angus Mackay3-Jan-07 23:07
Colin Angus Mackay3-Jan-07 23:07 
Jay_se wrote:
When I am retrieving the date from my DB, it will appended with TimeStamp
eg. 01/04/2007 12:00:00 . But I wish to display only the Date in the TextBox of my Web Page.

I am confused whether I can use Char or Varchar data type in my SQL Server DB to store Date Value or Any other way to convert the DateTime format of SQL Server into Date only format.


It is considered bad practice to store dates as strings. SQL Server has a DATETIME column type that you can use that is culture indepenent.

It is better to render the date in a culture specific way in the application's presentation layer. When a DATETIME column is read into a .NET application you get a .NET DateTime object. You can use its ToString() method to define exactly how you want the date to be formatted. e.g.
myDate.ToString("dd/MM/yyyy");


A quick reference off the top of my head:
d: day
dd: day with leading zero
h: hour (12)
hh: hour with leading zero (12)
H: hour (24)
HH: hour with leading zero (24)
m: minute
mm: minute with leading zero
M: month
MM: month with leading zero
MMM: short month name
MMMM: long month name
yy: short year
yyyy: long year with century


Upcoming Scottish Developers events:
* Glasgow: Tell us what you want to see in 2007


My: Website | Blog | Photos

GeneralRe: Date Format Pin
Jay_se4-Jan-07 0:50
Jay_se4-Jan-07 0:50 
Questionconnection string, ip, remote server connection Pin
steve_rm3-Jan-07 17:17
steve_rm3-Jan-07 17:17 
AnswerRe: connection string, ip, remote server connection Pin
Uri Lavi4-Jan-07 1:03
Uri Lavi4-Jan-07 1:03 
QuestionOptimization of INNER JOIN Pin
PIEBALDconsult3-Jan-07 11:31
mvePIEBALDconsult3-Jan-07 11:31 
AnswerRe: Optimization of INNER JOIN Pin
Chris Meech3-Jan-07 11:46
Chris Meech3-Jan-07 11:46 
GeneralRe: Optimization of INNER JOIN Pin
PIEBALDconsult4-Jan-07 3:47
mvePIEBALDconsult4-Jan-07 3:47 
AnswerRe: Optimization of INNER JOIN Pin
Mark J. Miller3-Jan-07 11:58
Mark J. Miller3-Jan-07 11:58 
GeneralRe: Optimization of INNER JOIN Pin
PIEBALDconsult4-Jan-07 5:46
mvePIEBALDconsult4-Jan-07 5:46 
GeneralRe: Optimization of INNER JOIN Pin
Mark J. Miller4-Jan-07 6:22
Mark J. Miller4-Jan-07 6:22 
Questionsql instances on LAN in combo in vb.net [modified] Pin
Hasan Jaffal3-Jan-07 10:24
Hasan Jaffal3-Jan-07 10:24 
AnswerRe: sql instances on LAN in combo in vb.net Pin
Hasan Jaffal4-Jan-07 4:05
Hasan Jaffal4-Jan-07 4:05 
QuestionDataset not saving the changes Pin
Irfan Faruki3-Jan-07 9:23
Irfan Faruki3-Jan-07 9:23 
AnswerRe: Dataset not saving the changes Pin
Mark J. Miller3-Jan-07 11:39
Mark J. Miller3-Jan-07 11:39 
GeneralRe: Dataset not saving the changes Pin
Irfan Faruki3-Jan-07 22:01
Irfan Faruki3-Jan-07 22:01 
QuestionBulk copy on Sql mobile 2005 Pin
Filip Landr2-Jan-07 21:14
Filip Landr2-Jan-07 21:14 
QuestionSQL Query not work Pin
jaganil2-Jan-07 21:12
jaganil2-Jan-07 21:12 
AnswerRe: SQL Query not work Pin
Elina Blank3-Jan-07 3:32
sitebuilderElina Blank3-Jan-07 3:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.