Nov 1, 2011

Object cannot be cast from dbnull to other types

This is a common error that you get when trying to display a field with no value (null), from a table.
Sol:
Convert.IsDBNull(dt.Rows[i]["Pass1"]) ? null : dt.Rows[i]["Pass1"].ToString();

0 comments:

Post a Comment

Your comments:

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More