我必须检查我的datarow中的第一个单元格是否是日期时间对象。我正在为它做下面的事情。请让我知道是否有更好的方法来做到这一点?有没有更好的方法来检查数据通道中的类型?
public bool ShouldProcess(DataRow theRow)
{
try
{
Convert.ToDateTime(theRow[0]);
}
catch (Exception)
{
return false;
}
return true;
}
感谢, -M