Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

date problem

Inderjeet SinghInderjeet Singh Member Posts: 1
in C#

Can Any one help on this :
i was coding with c# School Programmers Heaven By faraj Rasheed . done all the coding exactly same but i am constantly getting error at this line

row["dateOfPublishing"] = txtDateOfPublishing.Text
datadapter.Update(ds, "article");

unable to update data, if i enter date as anything less than 12 like 01/01/2000 or 03/05/2000 it is working fine but when i enter date above 12 it doesn't takes value like 13/05/2001 or 5/13/2001 Showing error like

13/5/2001- Conversion Failed while converting date and/or time from character

05/13/2001-'String was not recognized as a valid DateTime.Couldn't store <01-21-2007 00:00:00> in dateOfPublishing Column. Expected type is DateTime.'

I have even used date picker control also but same error displays..Seen lot on the web but do not understand how to do it my system date format is dd/mm/yyyy . i cannot change this format as per user demand..

Can anyone help please...

checked all the coding
checked all the convert function
tried with datetime picker control also..
also changed the SQL server field data type as datetime and datetime2
but no result same error

Tagged:
Sign In or Register to comment.