Top "Dbnull" questions

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

C#/Oracle10g = null vs DBNull.Value vs String.Empty

I'm making my first forays into Accessing Oracle from C#. I've discovered that that Oracle doesn't like VarChar parameters to …

c# oracle ado.net null dbnull
Operand type clash: nvarchar is incompatible with image

I'm using a SQL Server 2008 stored procedure to create a new record with this syntax: cmd.Parameters.Add("@photo", DBNull.…

vb.net image parameters dbnull
Why is this code invalid in C#?

The following code will not compile: string foo = "bar"; Object o = foo == null ? DBNull.Value : foo; I get: Error 1 Type …

c# nullable conditional-operator dbnull
Converting a DBNull to boolean when binding to checkbox in a detailsview control

This is kind of silly but I have a DetailsView that binds to a record in my database using a …

c# asp.net sqldatasource detailsview dbnull
How do I pass a null value into a parameter for a SqlCommand

Before anyone comments that this has been answered before in other question I KNOW that..but in spite of the …

c# sql-server dbnull sqlparameter
Difference between DbNull.Value and DbNull.Value.ToString()

I wanted to learn which usage is true? if(!string.IsNullOrEmpty(parentID)) cmd.Parameters.Add(new SqlParameter("@ParentSesID", parentID)); else …

c# dbnull sqlparameter
DBNull in non-empty cell when reading Excel file through OleDB

I use OleDB to read an Excel file. One of the columns has a "Common" format and contains both strings …

c# excel oledb dbnull
Linq and DBNull - Getting error

I'm getting an error when selecting from a rows.AsEnumerable(). I am using the following code... var rows = ds.Tables[0].…

c# linq null ienumerable dbnull
System.IndexOutOfRangeException on SQLDataReader Value Using C#

I have a SQLDataReader that returns three integers. However, there are occasions when two of the integers will return null …

c# asp.net sqldatareader dbnull