DB2Parameter.IsDefault Property

DB2®Parameter.IsDefault Property gets or sets a value indicating whether the parameter uses the default value assigned by the data server.

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

Syntax

[Visual Basic]
Public Overrides Property IsDefault As Boolean
[C#]
public override bool IsDefault {get; set;}
[C++]
public: __property bool get_IsDefault();
public: __property void set_IsDefault(bool);
[JScript]
public function get IsDefault() : Boolean;
public function set IsDefault(Boolean);

Property value

true if the parameter value is the default column value defined by the data server. The default is false.

Remarks

DB2Command.EnableExtendedIndicators must be set to true in order to use this property.

If this property is set to true, the Value property is ignored.

Setting both IsDefault and IsUnassigned to true results in an InvalidOperationException

Example

[Visual Basic, C#] The following example creates a DB2Parameter that uses the default data server value.

[Visual Basic]
Public Sub CreateDB2Parameter()
    Dim myParameter As New DB2Parameter("Description", DB2Type.VarChar, 88)
    myParameter.IsDefault = True
End Sub 'CreateDB2Parameter

[C#]
public void CreateDB2Parameter()
 {
    DB2Parameter myParameter = new DB2Parameter("Description", DB2Type.VarChar, 88);
    myParameter.IsDefault = true;
 }