Click here to Skip to main content
15,896,278 members

Comments by ammu11 (Top 21 by date)

ammu11 25-May-17 3:15am View    
@OriginalGriff I have done as you said by changing some code.
code is

string FromDate = DateTime.Now.AddDays(-2).ToString();
string Todate = DateTime.Now.ToString();

if (!String.IsNullOrEmpty(Todate.ToString()) && !String.IsNullOrEmpty(FromDate.ToString()))
{
BookingList = BookingList.Where(s => s.DateTime >= FromDate.ToDateFromString() && s.DateTime <= Todate.ToDateFromString()).ToList();
}

I have changed the code to this, why because only need to show last two days data and in db it has three fields and my problem here is that it is not showing and the count in BookingList is 0. Why is that ??
ammu11 25-May-17 2:37am View    
Can I please change the variable FromDate to item that is

var item = DateTime.Now.AddDays(-1);

then I am getting value for item as "2017-05-24 08:20:12" but in the second line

FromDateString = item.ToString();

here Iam getting null in FromDateString. since I have declared FromDateString as string so I have given item.tostring(), the the value in item is not passing to FromDateString . this is my problem I have checked with debugger
ammu11 25-May-17 2:26am View    
var FromDate = DateTime.Now.AddDays(-1);
when I give this I am getting yesterdays datetime to FromDate but
when I give this
FromDateString = FromDate.ToString();
the value in FromDate is not passing to FromDateString. Why is that ?? currently FromDateString is in string datatype . I need to passthe value in FromDate to FromDateString. Is that possible ?? When I give I am getting null value .
ammu11 25-May-17 2:13am View    
No I var FromDate I am getting the value that is datetime , this datetime in FromDate, I need to get this value to FromDateString, but it is showing as null. How can I get value to FromDateString ??
ammu11 24-May-17 5:01am View    
but where I need to give this ?view ? drop down list ??