Objects that you specified in the case of null DBNull.Value. - CSharp System

CSharp examples for System:DBNull

Description

Objects that you specified in the case of null DBNull.Value.

Demo Code


using System.Xml.Serialization;
using System.Text.RegularExpressions;
using System.Text;
using System.IO;/* ww  w  .j a va  2 s  .  c o  m*/
using System.Globalization;
using System.Collections.Generic;
using System;

public class Main{
        /// <summary>
        /// Objects that you specified in the case of null DBNull.Value.

        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static Object ToDbValue(Object value)
        {
            if (value == null)
            {
                return DBNull.Value;
            }
            return value;
        }
}

Related Tutorials