Null vs. DBNull – Powershell

Today I found out that there is a difference between $null and [DBNull] in powershell. One of my projects uses a MySQL DB, a newer query returns null data depending on a few scenarios. Because of this my process would fail as the null value wasn’t being handled correctly. After some digging it turns out that when querying a DB there is a difference between nulls.



idAccount    : 0017000000r3333
AccountName  : 1009333
DateCreated  : 03/02/2015 12:14:09
HomeFolder   : 0
SalesOrder   :
idAccount1   :
ProdLocation :
SalesOrder1  :
DateGen      :
CustURL      :
Processed    :



0 comments… add one

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.