ASP.NET - how to get after 15 days date from table

Asked By msakt on 02-Jul-12 02:19 AM
i want to show reminder for dob after 15 days date from table...

but,in table DOB field have varchar...value save like this  month/date(5/6)...how can i get
S K replied to msakt on 02-Jul-12 03:11 AM
You need to first convert the data from your table into datetime datatype and than simply get after 15 days record with where condition 
Neha Garg replied to msakt on 02-Jul-12 03:45 AM

Hello,

 

For that use the below code...in that first you have to make a date from your string field:

 

//Make a Date

      //if 5(May) is Month and 6 is Date

      string Getdate = "5/6";

      DateTime date = Convert.ToDateTime(Getdate + "/1999");

 

      return date.AddDays(15);

      //It will return Date {05/21/1999 12:00:00 AM}