Top "Dbnull" questions

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

Handle DBNull in C#

Is there a better/cleaner way to do this? int stockvalue = 0; if (!Convert.IsDBNull(reader["StockValue"])) stockvalue = (int)reader["StockValue"];

c# datareader dbnull
ExecuteScalar returns null or DBNull (development or production server)

I'm trying to add a column to an existing DataRow in C#. Afterwards the column will be filled with a …

c# dbnull asp.net-development-serv executescalar
How to manage parsing an null object for DateTime to be used with ADO.NET as DBNULL

I have two DateTime objects, BirthDate and HireDate. They are correctly formatted as a string and when I pass them …

c# parsing datetime ado.net dbnull
Cannot implicitly convert type 'decimal?' to 'decimal'.

sdr is my sqldatareader and I want to check that the curPrice value which is of type decimal is null. …

c# casting dbnull explicit-conversion
SqlDataReader Best way to check for null values -sqlDataReader.IsDBNull vs DBNull.Value

I want to retrieve decimal values from the database and I would like to know which is the recommended way …

c# ado.net sqldatareader dbnull
C# ADO.NET: nulls and DbNull -- is there more efficient syntax?

I've got a DateTime? that I'm trying to insert into a field using a DbParameter. I'm creating the parameter like …

c# ado.net null nullable dbnull
Dealing with System.DBNull in PowerShell

EDIT: As of PowerShell 7 Preview 2, -not [System.DBNull]::Value evaluates to $true, thanks to Joel Sallow via pull request 9794 Spending …

sql powershell dbnull
Passing DBNull.Value and Empty textbox value to database

I have some textboxes on my page which can be empty because they are optional and I have this DAL …

c# .net sql-server ado.net dbnull
Finding null value in Dataset - DataRow.IsNull method vs ==DbNull.Value - c#

What are the benefits of using the c# method DataRow.IsNull to determine a null value over checking if the …

c#-4.0 dataset datarow dbnull isnull
Powershell and SQL parameters. If empty string, pass DBNull

I got this parameter: $objDbCmd.Parameters.Add("@telephone", [System.Data.SqlDbType]::VarChar, 18) | Out-Null; $objDbCmd.Parameters["@telephone"].Value = $objUser.Telephone; Where …

sql powershell dbnull