次の方法で共有


SqlBinary.Length プロパティ

Value プロパティの長さをバイト数で取得します。このプロパティは読み取り専用です。

Public ReadOnly Property Length As Integer
[C#]
public int Length {get;}
[C++]
public: __property int get_Length();
[JScript]
public function get Length() : int;

プロパティ値

Value プロパティのバイナリ データの長さ。

例外

例外の種類 条件
SqlNullValueException Value プロパティに Null が格納されているときに、Length プロパティが読み取られました。

解説

SqlNullValueException が発生しないようにするには、Length プロパティを読み取る前に必ず IsNull プロパティを確認します。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

SqlBinary 構造体 | SqlBinary メンバ | System.Data.SqlTypes 名前空間