SqlDateTime.Explicit 運算子

定義

在參數與 SqlDateTime 結構之間來回轉換。

多載

Explicit(SqlDateTime to DateTime)

SqlDateTime 結構轉換成 DateTime 結構。

Explicit(SqlString to SqlDateTime)

SqlString 參數轉換成 SqlDateTime

Explicit(SqlDateTime to DateTime)

來源:
SQLDateTime.cs
來源:
SQLDateTime.cs
來源:
SQLDateTime.cs

SqlDateTime 結構轉換成 DateTime 結構。

public:
 static explicit operator DateTime(System::Data::SqlTypes::SqlDateTime x);
public static explicit operator DateTime (System.Data.SqlTypes.SqlDateTime x);
static member op_Explicit : System.Data.SqlTypes.SqlDateTime -> DateTime
Public Shared Narrowing Operator CType (x As SqlDateTime) As DateTime

參數

x
SqlDateTime

SqlDateTime 結構。

傳回

DateTime 物件,其 DateTimeOfDay 屬性包含與提供的 Value 結構之 SqlDateTime 屬性相同的日期與時間值。

備註

這個運算子的對等方法為 SqlDateTime.Value

另請參閱

適用於

Explicit(SqlString to SqlDateTime)

來源:
SQLDateTime.cs
來源:
SQLDateTime.cs
來源:
SQLDateTime.cs

SqlString 參數轉換成 SqlDateTime

public:
 static explicit operator System::Data::SqlTypes::SqlDateTime(System::Data::SqlTypes::SqlString x);
public static explicit operator System.Data.SqlTypes.SqlDateTime (System.Data.SqlTypes.SqlString x);
static member op_Explicit : System.Data.SqlTypes.SqlString -> System.Data.SqlTypes.SqlDateTime
Public Shared Narrowing Operator CType (x As SqlString) As SqlDateTime

參數

傳回

SqlDateTime 結構,其 Value 等於 SqlString 參數表示的日期與時間。 如果 SqlString 為 Null,則新建立的 SqlDateTime 結構之 Value 將會是 Null。

另請參閱

適用於