Nullable Values

  • Thread starter Thread starter Barry
  • Start date Start date
B

Barry

Hi

I need to insert some data value in a table, what is the nullable value for
bool? , for string type i used String.Empty

TIA
Barry
 
Barry said:
Hi

I need to insert some data value in a table, what is the nullable value
for bool?

bool? b = null;

If the bit field in the database is nullable, throwing a null at it, when
attempting an insert or update, will work.
for string type i used String.Empty

Why not just null.

string s = null;

The reason I suggest this is some databases have conditions where
string.empty is a valid answer that does not mean the same as null. In fact,
null equals an indeterminate value and an empty string is determinant, as it
is something instead of nothing.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Hi

Inserting null is not possible as the datatype is bool not bool?, the
datatype is auto-generated by the dataset.

Barry
 
Back
Top