更新时间:2023-02-09 14:23:41
Dim dt as DateTime = System.DBNull.Value
如果您使用的是.Net 2.0或更高版本,则始终可以使用可为空的类型.
将您的字段声明为DateTime? dt
;
然后设置dt = null
;
更新:
在VB.NET中,使用此命令:
If you are using .Net 2.0 or greater, you can always use a nullable type.
Declare your field asDateTime? dt
;
Then setdt = null
;
UPDATE:
In VB.NET, use this:
Dim dt As System.Nullable(Of DateTime)
dt = Nothing