How to tell whether a column can accept nulls

How can I tell if a column bound to a datatable can accept null values prior to a write to the database
LVL 1
bensonwalkerAsked:
Who is Participating?
 
Ajay SharmaCommented:
Dim colStatus As Boolean
colStatus = dataset1.datacolumn(0).AllowDBNull

Here the colStatus will be storing a boolean value stating the dbnull is allowed or not.

Here i am evaluating the status of first column (0th column).
Replace your column number in he statment instead of "0" .
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.