DB2Date Structure

Represents the DATE Db2®x data type. Encapsulates the DateTime .NET data type.

Namespace:
IBM.Data.DB2Types
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Inheritance hierarchy


System.Object
   IBM.Data.DB2.DB2Date

Syntax


[Visual Basic]
Public Structure DB2Date
[C#]
public struct DB2Date
[C++]
public value class DB2Date

Example

[C#] The following example demonstrates how to retrieve a single DATE column value from a table.

[C#]
  public static string getParam(DB2Connection conn)
  {
    string mySelectQuery = "SELECT * FROM EMPLOYEE";
    DB2Command myCommand = new DB2Command(mySelectQuery, conn);
    DB2DataReader reader = myCommand.ExecuteReader();

    if (reader.Read())
    {
      DB2Time selectValue = reader.GetDB2Time(6);

      if (!selectValue.IsNull) { return selectValue.ToString(); }
    }

    return "NULL";
  }

Thread safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.