[问题] 请问dr[i].GetType() 的if怎么写?

楼主: ChenRobert (罗伯陈)   2022-07-23 18:23:29
if (dr[i].GetType() == System.DateTime)
{
}
我的判断是只要是DataTime就要独立抓出来,请问这语法要怎么写?
写System.DateTime 会 compile error
作者: sating00 (sating00)   2022-07-23 20:54:00
typeof()
作者: iterator (rotareti)   2022-07-25 09:23:00
用 if (dr[i] is System.DateTime)C# 7 以后,还有 swtich (dr[i]) case DateTime dt1:

Links booklink

Contact Us: admin [ a t ] ucptt.com