Dear All,
This is a similar question I have asked earlier but have not found solution to the same. But as I have tried and made several changes in code, hence posting as new question.
I am using a textbox to get date in asp.net page to sql 2012 database.
The code works fine while debugging but gives error when published.
Field type in database: datetime
Code used for conversion:
Dim varTargetDate As Date = DateTime.ParseExact(Convert.ToDateTime(txtTargetDate.Text), "dd-MM-yyyy", CultureInfo.InvariantCulture)
Short date format of machine:
dd-MM-yyyy
long date format of machine:
dd MMMM yyyy
Format: English(India)
Parameter for insert command:
daCreate.InsertCommand.Parameters.Add(New SqlParameter("@ROUTTD", varTargetDate))
Any details required from my side, pls let me know.
Thanks ..
Following command in sql to check stored format:
SELECT CONVERT(varchar(20), routtd, 107) AS Expr1 FROM ROUT
The result from command:
Oct 09, 2014