Vignesh Kumar

Vignesh Kumar

  • NA
  • 1k
  • 403.6k

Convert date to datetime c#

Jun 10 2014 8:54 AM

Hi,

I have a gridview with the column displaying date value. But in DB its datetime datatype.

Label date = (Label)GridView1.Rows[e.RowIndex].FindControl("Date");

In my screen the date value displays like `2014-05-3O` in the grid and in database the value is like `2014-05-30 00:00:00.000`, where I converted datetime to date to show it in the screen. Now I m trying to delete the row and it gives an error. The problem is how can I convert this date to datetime, so that I can pass the string in the delete statement.

Anyone help me with this?



Answers (3)