Posts

Showing posts from October, 2016

Error - “Specified cast is not valid” in LINQ when DateTime field is null

You are trying to convert a non-standard format, so use this: Try using DateTime .ParseExact.   string dateStr = "15/07/2001";   DateTime date = DateTime .ParseExact(dateStr, "dd-MM-yyyy HH:mm:ss",      System.Globalization. CultureInfo .InvariantCulture);

Get Data in a Generic List after the Post Back

First you have to create a class      [ Serializable ]     public class Keyword     {               [ Serializable ]         public class Item         {             public string KeywordId { get ; set ; }         }         [ Serializable ]         public class KeywordList         {             public List < Item > KeywordId()             {                 return null ;    ...