set
getdate()
something like this:
ALTER TABLE [TableName] ADD DEFAULT (getdate()) FOR [ColumnName]
Go
as default in your table will give you current insert date and time for Sql server
There are two possible ways :
- From your code behind
- From Select Query from Database
example to select only date from date time :
//from code behind
Variable_Name = DateTime.Now.ToString("dd/MM/yyyy");
or
-- from Database query
SELECT CONVERT (DATE, GETDATE())