使用SqlHelper的一个小技巧(3)
If (Not p.Value Is Nothing AndAlso Not p.Value Is DBNull.Value) Then
Dim str As String = p.Value.ToString()
If (Config.TrimString) Then
str = str.Trim()
End If
If (Config.EmptyStringToNull AndAlso str.Length = 0) Then
str = Nothing
End If
p.Value = str
End If
Case DbType.Boolean
If (Config.NullBooleanToFalse AndAlso p.Value Is Nothing) Then
p.Value = False
End If
End Select
If (Config.NullValueToDBNull AndAlso p.Value Is Nothing) Then
p.Value = DBNull.Value
End If
相关新闻>>
- 发表评论
-
- 最新评论 更多>>