IDataRecord.IsDBNull(Int32) Metoda
Definicja
Zwróć, czy określone pole ma wartość null.Return whether the specified field is set to null.
public:
bool IsDBNull(int i);
public bool IsDBNull (int i);
abstract member IsDBNull : int -> bool
Public Function IsDBNull (i As Integer) As Boolean
Parametry
- i
- Int32
Indeks pola do znalezienia.The index of the field to find.
Zwraca
true
Jeśli określone pole ma wartość null; w przeciwnym razie false
.true
if the specified field is set to null; otherwise, false
.
Wyjątki
Przekazano indeks poza zakresem od 0 do FieldCount .The index passed was outside the range of 0 through FieldCount.
Uwagi
Wywołaj tę metodę, aby sprawdzić, czy wartości kolumny mają wartość null przed wywołaniem wpisanych metod get (na przykład,, GetByte GetChar i tak dalej), aby uniknąć ponoszenia błędu.Call this method to see if there are null column values before calling the typed get methods (for example, GetByte, GetChar, and so on) to avoid raising an error.