SqlDataReader.GetDateTimeOffset(Int32) 方法
定義
擷取指定資料行的值做為 DateTimeOffset 物件。Retrieves the value of the specified column as a DateTimeOffset object.
public:
virtual DateTimeOffset GetDateTimeOffset(int i);
public virtual DateTimeOffset GetDateTimeOffset (int i);
abstract member GetDateTimeOffset : int -> DateTimeOffset
override this.GetDateTimeOffset : int -> DateTimeOffset
Public Overridable Function GetDateTimeOffset (i As Integer) As DateTimeOffset
參數
- i
- Int32
以零為基底的資料行序數。The zero-based column ordinal.
傳回
指定的資料行值。The value of the specified column.
例外狀況
指定的轉型無效。The specified cast is not valid.
備註
不會執行任何轉換;因此,抓取的資料必須已經是 DateTimeOffset 物件。No conversions are performed; therefore, the data retrieved must already be a DateTimeOffset object.
呼叫 IsDBNull,在呼叫這個方法之前,先檢查是否有 null 值。Call IsDBNull to check for null values before calling this method.