I want to assign default value to timestamp datatype in c#?
I have an object of table in c#.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A SQL TimeStamp is based on insert / update order on your sql server. There is no way to assign it from within C#. I doubt SQL will even allow you to update a column of type TimeStamp.
TimeStamp is a binary sequence. (8 bytes I believe.) There is no correlation to a DateTime. Nothing to display for the user on a page.
If you want to show the user when a record was last modified or first created, you will have to maintain separate fields of type DateTime and update the values in either your application or within sql using sprocs or triggers.