System.Data.DataRow.IsNull C# (CSharp) Method

IsNull() public method

Gets a value indicating whether the specified contains a null value.
public IsNull ( DataColumn column ) : bool
column DataColumn
return bool
        public bool IsNull(DataColumn column)
        {
            CheckColumn(column);
            int record = GetDefaultRecord();
            return column.IsNull(record);
        }

Same methods

DataRow::IsNull ( DataColumn column, DataRowVersion version ) : bool
DataRow::IsNull ( int columnIndex ) : bool
DataRow::IsNull ( string columnName ) : bool

Usage Example

Example #1
0
 /// <summary>
 /// convert one row to Form1
 /// warning: this row must include all the columns of table(form_1)
 /// </summary>
 /// <param name="row">a data row that include all the column of table(form_1)</param>
 /// <returns>an entity of Form1</returns>
 public void FillEntityByRow(Form1Info entity, System.Data.DataRow row)
 {
     if (!row.IsNull("form_no"))
     {
         entity.FormNo = (int)row["form_no"];
     }
     else
     {
     }
     if (!row.IsNull("amount"))
     {
         entity.Amount = (int)row["amount"];
     }
     else
     {
     }
     if (!row.IsNull("leader"))
     {
         entity.Leader = (string)row["leader"];
     }
     else
     {
     }
     if (!row.IsNull("manager"))
     {
         entity.Manager = (string)row["manager"];
     }
     else
     {
     }
 }
All Usage Examples Of System.Data.DataRow::IsNull