次の方法で共有


DataRow.IsNull メソッド (String)

指定した列に null 値が格納されているかどうかを示す値を取得します。

Overloads Public Function IsNull( _
   ByVal columnName As String _) As Boolean
[C#]
public bool IsNull(stringcolumnName);
[C++]
public: bool IsNull(String* columnName);
[JScript]
public function IsNull(
   columnName : String) : Boolean;

パラメータ

  • columnName
    列の名前。

戻り値

列が null 値を格納している場合は true 。それ以外の場合は false

使用例

[Visual Basic] 列の値を null 値に変更し、 IsNull メソッドを使用して、列の値が null かどうかを確認する例を次に示します。

 
Private Sub IsValNull()
   Dim t As DataTable
   Dim r As DataRow
   ' Assuming the DataGrid is bound to a DataTable.
   t = CType(DataGrid1.DataSource, DataTable)

   r = t.Rows(datagrid1.CurrentCell.RowNumber)
   r.BeginEdit
   r("FirstName") = System.DBNull.Value
   r.EndEdit
   r.AcceptChanges
   Console.WriteLine(r.IsNull("FirstName"))
End Sub

[C#, C++, JScript] C#、C++、および JScript のサンプルはありません。Visual Basic のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

DataRow クラス | DataRow メンバ | System.Data 名前空間 | DataRow.IsNull オーバーロードの一覧