Top "Dbnull" questions

DBNull is a special value in The .Net framework indicating that the value is NULL in the database.

Assign null to a SqlParameter

The following code gives an error - "No implicit conversion from DBnull to int." SqlParameter[] parameters = new SqlParameter[1]; SqlParameter planIndexParameter = …

c# dbnull sqlparameter
handling dbnull data in vb.net

I want to generate some formatted output of data retrieved from an MS-Access database and stored in a DataTable object/…

vb.net dbnull
Most efficient way to check for DBNull and then assign to a variable?

This question comes up occasionally, but I haven't seen a satisfactory answer. A typical pattern is (row is a DataRow): …

.net dbnull
DBNull if statement

I'm trying to execute a stored procedure and then use an if statement to check for null values and I'm …

c# dbnull
SQLite equivalent to ISNULL(), NVL(), IFNULL() or COALESCE()

I'd like to avoid having many checks like the following in my code: myObj.someStringField = rdr.IsDBNull(someOrdinal) ? string.Empty : …

.net sqlite dbnull
What is the difference between null and System.DBNull.Value?

Is there any difference between null and System.DBNull.Value? If yes, what is it? I noticed this behavior now …

c# null dbnull
Conversion from type 'DBNull' to type 'String' is not valid

i am receiving this problem Conversion from type 'DBNull' to type 'String' is not valid. Line 501: hfSupEmail.Value = dt.Rows(0)("…

asp.net vb.net string dbnull
Implicit conversion from data type nvarchar to varbinary(max) is not allowed

I get this exception when I try to insert a DBNull.Value into a nullable varbinary(max) field: Implicit conversion …

sql insert dbnull varbinarymax
How do I handle Conversion from type 'DBNull' to type 'String' is not valid

I need some expect advice on how to handle the following:- I have a data field misc_text_2 that …

asp.net dbnull
Handling a DateTime DBNull

I have seen many, many versions of this on SO, but none of them seem to quite work for my …

c# datetime dbnull