I want to compare( before or after) a database cell value containing date (in dd/MM/yyyy format) to a date in DateTime Picker in ASP.net.
can any one help me??
string str2 = "select ITEM,INSTALLMENT,AMOUNT from Class_Fee where CLASS='" + classdrop.SelectedItem + "' and S_DATE>'" + feedate .SelectedDate +"' ";
Extract the DateTime
value from DB using dataRow1
in for loop, convert the achieved result to string using ToString()
and then use the following : DateTime dateTime = DateTime.ParseExact(dateString, "dd/MM/yyyy", 0);
and then compare it with the value of the ASP.net page
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.