Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get current datetime in gridview?

enter image description here

now here is a problem with me that how can I enter the current date in gridview. And when i sell the stock I can add it in TOTAL but when the next day will come the records will insert in next row then i want to add the sell record of the day agian in total for that day only in other words day by day record of sell stock will add in "total"(only for sell stock of the day).

like image 278
avirk Avatar asked Nov 13 '22 22:11

avirk


1 Answers

One option is to set the default value in the database column to be todays date for all new records.

Another possibility is to set a default value on the DataTable with something like: <<DataTable>>.Columns["Date"].DefaultValue = System.DateTime.Today. The disadvantage of the default value on the DataTable is you need to be careful to update the default value if the application runs over midnight

like image 193
IndigoDelta Avatar answered Dec 19 '22 03:12

IndigoDelta