Click here to Skip to main content
16,004,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: Raising an event Pin
gauthee13-Mar-07 21:14
gauthee13-Mar-07 21:14 
AnswerRe: Raising an event Pin
Sandeep Akhare13-Mar-07 22:07
Sandeep Akhare13-Mar-07 22:07 
QuestionStreet Mapping Software Pin
Taurian11013-Mar-07 20:23
Taurian11013-Mar-07 20:23 
Questionadding treeview on Panel control Pin
EEmaan13-Mar-07 20:19
EEmaan13-Mar-07 20:19 
QuestionDateTime Conversion Pin
gauthee13-Mar-07 19:29
gauthee13-Mar-07 19:29 
AnswerRe: DateTime Conversion Pin
N a v a n e e t h13-Mar-07 19:39
N a v a n e e t h13-Mar-07 19:39 
GeneralRe: DateTime Conversion Pin
gauthee13-Mar-07 19:54
gauthee13-Mar-07 19:54 
AnswerRe: DateTime Conversion Pin
Guffa13-Mar-07 19:51
Guffa13-Mar-07 19:51 
gauthee wrote:
I have a value returning from a database and that value is of datetime format dd/mm/yyy.


No, you don't. A datetime value doesn't have a format at all. Either you have a datetime value, or you have a string that represents a datetime value. As you are getting an error converting it to a datetime value, it has to be the later.

If possible, you should convert the data type in the database so that you are storing the datetime values as datetime values, not as strings.

Otherwise you have to specify the format when you are parsing the strings that you get from the database:

DateTime somewhereInTime = DateTime.ParseExact((string)objdr["startdate"], "dd/MM/yyyy", CultureInfo.InvariantCulture);



---
single minded; short sighted; long gone;

GeneralRe: DateTime Conversion Pin
gauthee13-Mar-07 20:33
gauthee13-Mar-07 20:33 
AnswerRe: DateTime Conversion Pin
Harini N K13-Mar-07 20:24
Harini N K13-Mar-07 20:24 
AnswerRe: DateTime Conversion Pin
Keshav V. Kamat13-Mar-07 21:39
Keshav V. Kamat13-Mar-07 21:39 
Questionsyntax for drop sql table Pin
Keshav V. Kamat13-Mar-07 19:13
Keshav V. Kamat13-Mar-07 19:13 
AnswerRe: syntax for drop sql table Pin
N a v a n e e t h13-Mar-07 19:40
N a v a n e e t h13-Mar-07 19:40 
GeneralRe: syntax for drop sql table Pin
Keshav V. Kamat13-Mar-07 20:20
Keshav V. Kamat13-Mar-07 20:20 
QuestionToolbar and Server Explorer - type dialogs Pin
swjam13-Mar-07 19:09
swjam13-Mar-07 19:09 
QuestionProblem with POP email reading windows service Pin
Nitin198113-Mar-07 18:28
Nitin198113-Mar-07 18:28 
QuestionJustify text Pin
Duong Tien Nam13-Mar-07 17:51
Duong Tien Nam13-Mar-07 17:51 
AnswerRe: Justify text Pin
Duong Tien Nam13-Mar-07 20:20
Duong Tien Nam13-Mar-07 20:20 
QuestionInformation Lists Pin
JMOdom13-Mar-07 16:04
JMOdom13-Mar-07 16:04 
QuestionURGENT! Pin
jotorres13-Mar-07 15:25
jotorres13-Mar-07 15:25 
QuestionSimple CSV Reader part 2 Pin
thenamenoonehastaken13-Mar-07 13:52
thenamenoonehastaken13-Mar-07 13:52 
QuestionHow do I capturing the ouput of the external appl Pin
Eyungwah13-Mar-07 13:22
Eyungwah13-Mar-07 13:22 
AnswerRe: How do I capturing the ouput of the external appl Pin
Stefan Troschuetz13-Mar-07 23:10
Stefan Troschuetz13-Mar-07 23:10 
QuestionCustom object as datasource to datagrid Pin
chequis13-Mar-07 13:19
chequis13-Mar-07 13:19 
Questionhow i can make color to active line in richtextBox ? Pin
Ahmed R El Bohoty13-Mar-07 13:11
Ahmed R El Bohoty13-Mar-07 13:11 

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.