SqlMetaData.MaxLength Property

Definition

Gets the maximum length of the column or parameter.

C#
public long MaxLength { get; }

Property Value

The maximum length of the column or parameter as a Int64.

Remarks

The potential maximum length for values of the specified column. Returns 0 for types other than fixed and varying length character and binary types. For variable size columns or parameters declared with the Max constructor parameter, it returns -1.

For DbType.Row this returns the number of columns in the row metadata instance.

The default value is 0.

Applies to

Proizvod Verzije
.NET Core 1.0, Core 1.1
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1