المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : DateTime NullReferenceException



C# Programming
11-26-2012, 03:02 PM
In the code snippet below when i try to check if column row is not equal to null is throw an error: System.NullReferenceException: Object reference not set to an instance of an object

SPList srcList = web.List["My List Name"];
foreach(SPListItem item in srcList.Items)
{
if((DateTime)item["Start Date"] != null)
{
//do something
}
}