I am trying to format the date in a specific order
Time = DateTime.Parse(p.Time.ToString("dd-MM-yyyy HH:mm:ss"))
Data Type Time-DateTime
But I get this error:
No overload for the "ToString" method takes 1 argument.
p is the object of the table from which I get the time.
List<ProductImageMapWrapper> lstpm = new List<ProductImageMapWrapper>();
lstpm = _db.ProductImageMaps.Where(i => i.ClientId == null && i.BrandId == null).Select(p => new ProductImageMapWrapper
{
Time=
}
Now I tried to use it that way
Time = DateTime.Parse(string.Format("{dd-MM-yyyy HH:mm:ss}", p.Time))
but then I got this error:
LINQ to Entities does not recognize the method System.DateTime Parse(System.String), and this method cannot be translated into a storage expression.
source
share