• I am not certain about ADO.NET but should not you set DBNULL.Value to your variable d?

    (Sorry if I am holding the other end of the stick)

    ---------------------------------------------------------------------------------