Export (0) Print
Expand All

SqlDateTime Structure

Represents the date and time data ranging in value from January 1, 1753 to December 31, 9999 to an accuracy of 3.33 milliseconds to be stored in or retrieved from a database. The SqlDateTime structure has a different underlying data structure from its corresponding .NET Framework type, DateTime, which can represent any time between 12:00:00 AM 1/1/0001 and 11:59:59 PM 12/31/9999, to the accuracy of 100 nanoseconds. SqlDateTime actually stores the relative difference to 00:00:00 AM 1/1/1900. Therefore, a conversion from "00:00:00 AM 1/1/1900" to an integer will return 0.

Namespace:  System.Data.SqlTypes
Assembly:  System.Data (in System.Data.dll)

[SerializableAttribute]
public value class SqlDateTime : INullable, 
	IComparable, IXmlSerializable

The SqlDateTime type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkSqlDateTime(DateTime)Initializes a new instance of the SqlDateTime structure using the specified DateTime value.
Public methodSupported by the XNA FrameworkSqlDateTime(Int32, Int32)Initializes a new instance of the SqlDateTime structure using the supplied parameters.
Public methodSupported by the XNA FrameworkSqlDateTime(Int32, Int32, Int32)Initializes a new instance of the SqlDateTime structure using the supplied parameters to initialize the year, month, day.
Public methodSupported by the XNA FrameworkSqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32)Initializes a new instance of the SqlDateTime structure using the supplied parameters to initialize the year, month, day, hour, minute, and second of the new structure.
Public methodSupported by the XNA FrameworkSqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Double)Initializes a new instance of the SqlDateTime structure using the supplied parameters to initialize the year, month, day, hour, minute, second, and millisecond of the new structure.
Public methodSupported by the XNA FrameworkSqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32)Initializes a new instance of the SqlDateTime structure using the supplied parameters to initialize the year, month, day, hour, minute, second, and billisecond of the new structure.
Top

  NameDescription
Public propertySupported by the XNA FrameworkDayTicksGets the number of ticks representing the date of this SqlDateTime structure.
Public propertySupported by the XNA FrameworkIsNullIndicates whether this SqlDateTime structure is null.
Public propertySupported by the XNA FrameworkTimeTicksGets the number of ticks representing the time of this SqlDateTime structure.
Public propertySupported by the XNA FrameworkValueGets the value of the SqlDateTime structure. This property is read-only.
Top

  NameDescription
Public methodStatic memberSupported by the XNA FrameworkAddAdds a SqlDateTime to the specified TimeSpan.
Public methodSupported by the XNA FrameworkCompareTo(Object)Compares this SqlDateTime structure to the supplied Object and returns an indication of their relative values.
Public methodSupported by the XNA FrameworkCompareTo(SqlDateTime)Compares this SqlDateTime structure to the supplied SqlDateTime structure and returns an indication of their relative values.
Public methodSupported by the XNA FrameworkEquals(Object)Compares the supplied object parameter to the Value property of the SqlDateTime object. (Overrides ValueType::Equals(Object).)
Public methodStatic memberSupported by the XNA FrameworkEquals(SqlDateTime, SqlDateTime)Performs a logical comparison of two SqlDateTime structures to determine whether they are equal.
Public methodSupported by the XNA FrameworkGetHashCodeGets the hash code for this instance. (Overrides ValueType::GetHashCode().)
Public methodSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberSupported by the XNA FrameworkGetXsdTypeReturns the XML Schema definition language (XSD) of the specified XmlSchemaSet.
Public methodStatic memberSupported by the XNA FrameworkGreaterThanCompares two instances of SqlDateTime to determine whether the first is greater than the second.
Public methodStatic memberSupported by the XNA FrameworkGreaterThanOrEqualCompares two instances of SqlDateTime to determine whether the first is greater than or equal to the second.
Public methodStatic memberSupported by the XNA FrameworkLessThanCompares two instances of SqlDateTime to determine whether the first is less than the second.
Public methodStatic memberSupported by the XNA FrameworkLessThanOrEqualCompares two instances of SqlDateTime to determine whether the first is less than or equal to the second.
Public methodStatic memberSupported by the XNA FrameworkNotEqualsPerforms a logical comparison of two instances of SqlDateTime to determine whether they are not equal.
Public methodStatic memberSupported by the XNA FrameworkParseConverts the specified String representation of a date and time to its SqlDateTime equivalent.
Public methodStatic memberSupported by the XNA FrameworkSubtractSubtracts the specified Timespan from this SqlDateTime instance.
Public methodSupported by the XNA FrameworkToSqlStringConverts this SqlDateTime structure to SqlString.
Public methodSupported by the XNA FrameworkToStringConverts this SqlDateTime structure to a String. (Overrides ValueType::ToString().)
Top

  NameDescription
Public operatorStatic memberSupported by the XNA FrameworkAdditionAdds the period of time indicated by the supplied TimeSpan parameter, t, to the supplied SqlDateTime structure.
Public operatorStatic memberSupported by the XNA FrameworkEqualityPerforms a logical comparison of two SqlDateTime structures to determine whether they are equal.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlDateTime to DateTime)Converts the SqlDateTime structure to a DateTime structure.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlString to SqlDateTime)Converts the SqlString parameter to a SqlDateTime.
Public operatorStatic memberSupported by the XNA FrameworkGreaterThanCompares two instances of SqlDateTime to determine whether the first is greater than the second.
Public operatorStatic memberSupported by the XNA FrameworkGreaterThanOrEqualCompares two instances of SqlDateTime to determine whether the first is greater than or equal to the second.
Public operatorStatic memberSupported by the XNA FrameworkImplicit(DateTime to SqlDateTime)Converts a DateTime structure to a SqlDateTime structure.
Public operatorStatic memberSupported by the XNA FrameworkInequalityPerforms a logical comparison of two instances of SqlDateTime to determine whether they are not equal.
Public operatorStatic memberSupported by the XNA FrameworkLessThanCompares two instances of SqlDateTime to determine whether the first is less than the second.
Public operatorStatic memberSupported by the XNA FrameworkLessThanOrEqualCompares two instances of SqlDateTime to determine whether the first is less than or equal to the second.
Public operatorStatic memberSupported by the XNA FrameworkSubtractionSubtracts the supplied TimeSpan structure, t, from the supplied SqlDateTime structure.
Top

  NameDescription
Public fieldStatic memberSupported by the XNA FrameworkMaxValueRepresents the maximum valid date value for a SqlDateTime structure.
Public fieldStatic memberSupported by the XNA FrameworkMinValueRepresents the minimum valid date value for a SqlDateTime structure.
Public fieldStatic memberSupported by the XNA FrameworkNullRepresents a DBNull that can be assigned to this instance of the SqlDateTime structure.
Public fieldStatic memberSupported by the XNA FrameworkSQLTicksPerHourA constant whose value is the number of ticks equivalent to one hour.
Public fieldStatic memberSupported by the XNA FrameworkSQLTicksPerMinuteA constant whose value is the number of ticks equivalent to one minute.
Public fieldStatic memberSupported by the XNA FrameworkSQLTicksPerSecondA constant whose value is the number of ticks equivalent to one second.
Top

  NameDescription
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIXmlSerializable::GetSchemaThis member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIXmlSerializable::ReadXmlThis member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIXmlSerializable::WriteXmlThis member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Top

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft