DataObjectFieldAttribute コンストラクタ (Boolean)
アセンブリ: System (system.dll 内)

Public Sub New ( _ primaryKey As Boolean _ )
Dim primaryKey As Boolean Dim instance As New DataObjectFieldAttribute(primaryKey)
public DataObjectFieldAttribute ( bool primaryKey )
public: DataObjectFieldAttribute ( bool primaryKey )
public DataObjectFieldAttribute ( boolean primaryKey )
public function DataObjectFieldAttribute ( primaryKey : boolean )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataObjectFieldAttribute コンストラクタ (Boolean, Boolean)
アセンブリ: System (system.dll 内)

Dim primaryKey As Boolean Dim isIdentity As Boolean Dim instance As New DataObjectFieldAttribute(primaryKey, isIdentity)
public DataObjectFieldAttribute ( bool primaryKey, bool isIdentity )
public: DataObjectFieldAttribute ( bool primaryKey, bool isIdentity )
public DataObjectFieldAttribute ( boolean primaryKey, boolean isIdentity )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataObjectFieldAttribute コンストラクタ (Boolean, Boolean, Boolean)
アセンブリ: System (system.dll 内)

Dim primaryKey As Boolean Dim isIdentity As Boolean Dim isNullable As Boolean Dim instance As New DataObjectFieldAttribute(primaryKey, isIdentity, isNullable)
public function DataObjectFieldAttribute ( primaryKey : boolean, isIdentity : boolean, isNullable : boolean )

パブリックに公開されたプロパティに DataObjectFieldAttribute を適用し、プロパティに関連付けられたメタデータを識別する方法を次のコード例に示します。この例では、NorthwindEmployee 型で、EmployeeID、FirstName、および LastName の 3 つのデータのプロパティを公開します。DataObjectFieldAttribute 属性は 3 つすべてのプロパティに適用されますが、EmployeeID プロパティの属性だけが、これがデータ行の主キーであることを示します。
Public Class NorthwindEmployee Public Sub New() End Sub 'New Private _employeeID As Integer <DataObjectFieldAttribute(True, True, False)> _ Public Property EmployeeID() As Integer Get Return _employeeID End Get Set(ByVal value As Integer) _employeeID = value End Set End Property Private _firstName As String = String.Empty <DataObjectFieldAttribute(False, False, False)> _ Public Property FirstName() As String Get Return _firstName End Get Set(ByVal value As String) _firstName = value End Set End Property Private _lastName As String = String.Empty <DataObjectFieldAttribute(False, False, False)> _ Public Property LastName() As String Get Return _lastName End Get Set(ByVal value As String) _lastName = value End Set End Property End Class 'NorthwindEmployee
public class NorthwindEmployee { public NorthwindEmployee() { } private int _employeeID; [DataObjectFieldAttribute(true, true, false)] public int EmployeeID { get { return _employeeID; } set { _employeeID = value; } } private string _firstName = String.Empty; [DataObjectFieldAttribute(false, false, true)] public string FirstName { get { return _firstName; } set { _firstName = value; } } private string _lastName = String.Empty; [DataObjectFieldAttribute(false, false, true)] public string LastName { get { return _lastName; } set { _lastName = value; } } }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataObjectFieldAttribute コンストラクタ (Boolean, Boolean, Boolean, Int32)
アセンブリ: System (system.dll 内)

Public Sub New ( _ primaryKey As Boolean, _ isIdentity As Boolean, _ isNullable As Boolean, _ length As Integer _ )
Dim primaryKey As Boolean Dim isIdentity As Boolean Dim isNullable As Boolean Dim length As Integer Dim instance As New DataObjectFieldAttribute(primaryKey, isIdentity, isNullable, length)
public DataObjectFieldAttribute ( boolean primaryKey, boolean isIdentity, boolean isNullable, int length )
public function DataObjectFieldAttribute ( primaryKey : boolean, isIdentity : boolean, isNullable : boolean, length : int )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataObjectFieldAttribute コンストラクタ

名前 | 説明 |
---|---|
DataObjectFieldAttribute (Boolean) | DataObjectFieldAttribute クラスの新しいインスタンスを初期化し、フィールドがデータ行の主キーかどうかを示します。 |
DataObjectFieldAttribute (Boolean, Boolean) | DataObjectFieldAttribute クラスの新しいインスタンスを初期化し、フィールドがデータ行の主キーかどうか、フィールドがデータベースの ID フィールドかどうかを示します。 |
DataObjectFieldAttribute (Boolean, Boolean, Boolean) | DataObjectFieldAttribute クラスの新しいインスタンスを初期化し、フィールドがデータ行の主キーかどうか、フィールドがデータベースの ID フィールドかどうか、フィールドを null にできるかどうかを示します。 |
DataObjectFieldAttribute (Boolean, Boolean, Boolean, Int32) | DataObjectFieldAttribute クラスの新しいインスタンスを初期化し、フィールドがデータ行の主キーかどうか、データベースの ID フィールドかどうか、null にできるかどうかを示し、フィールドの長さも設定します。 |

- DataObjectFieldAttribute コンストラクタのページへのリンク