Hey Ubaid,
What have you tried, or where do you get stuck? Is seems to be a straight forward solution, so I'm curious how what you've done so far?
You should query the database for the expiration date. You can calculate the total amount of days using a timespan :
Timespan ts = DateTime.Now - expirationDate;
Console.WriteLine("Password expires in " + ts.TotalDays + " days");
If you still run into problems, please describe in more detail where you get stuck. This helps us to point to in the right direction.
Hope it helps,
Eduard