c# - DataTable Format -
i have question. i'm working on asp.net c#, , change date format of datatable. datatable gest source sql, , performed dd/mm/yyyy h:mm:ss
, change dd/mm/yyyy
. if execute query in sql, format wish, problem in datatable. also, set datatable reportviwer. thanks.
edit: code give datatable format
datatable table=(get source sql); (int = 0; < tabla.rows.count;i++) { string date= ""; calendar cl = new calendar(); date= table.rows[i]["limitdate"]= .tostring(); cl.selecteddate = system.datetime.parse(date); table.rows[i]["limitdate"]= cl.selecteddate.day.tostring() + "/" + cl.selecteddate.month.tostring() + "/" + cl.selecteddate.year.tostring(); }
if run code below gridview, works. however, datatable not working
use table.rows[i]["limitdate"]=cl.selecteddate.day.tostring("dd/mm/yyyy");
or take substring of dd/mm/yyyy h:mm:ss format string
Comments
Post a Comment