I would like to know when the database was timestamped from c# code.. Is this possible and if so, how can I do it?
It sounds like you may want a column in your table which is automatically updated by the database itself on update (e.g. with a trigger). Personally I prefer to let the database perform this task rather than the client, as it means you can get it right in one place and be certain that nothing else can modify the data (even with SQL entered manually) without the timestamp being updated.
Of course, that's assuming you're talking about a row-level timestamp recording the last change. The question isn't clear about that.
you can do as below and store in the database
private String GetTimestamp(DateTime value) {
return value.ToString("yyyyMMddHHmmssffff");
}
This will give you a string like 201105211035131468
精彩评论