Hi,
How to find last update records in table, is possible to check it dataset?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sandeep Singh ShekhawatPosted Oct 23, 2012, 2:31 AM
There is not straightforward way to get last update record So I will suggest some point:
1. create a column in table like lastUpadte and write code like
SqlCommand cmd = new SqlCommand("select max(lastUpadte) from employee" , conn);
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
Console.WriteLine(reader["Name"]);
}
2. Create an timestamp column and use it to get updated data:
http://msdn.microsoft.com/en-us/library/aa260631(v=sql.80).aspx
Thanks
Sandeep