DataObjectFieldAttribute コンストラクタとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataObjectFieldAttribute コンストラクタの意味・解説 

DataObjectFieldAttribute コンストラクタ (Boolean)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

DataObjectFieldAttribute クラス新しインスタンス初期化しフィールドデータ行の主キーかどうか示します

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

public DataObjectFieldAttribute (
    bool primaryKey
)
public:
DataObjectFieldAttribute (
    bool primaryKey
)
public DataObjectFieldAttribute (
    boolean primaryKey
)
public function DataObjectFieldAttribute (
    primaryKey : boolean
)

パラメータ

primaryKey

フィールドデータ行の主キー含まれることを示す場合trueそれ以外場合false

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataObjectFieldAttribute クラス
DataObjectFieldAttribute メンバ
System.ComponentModel 名前空間

DataObjectFieldAttribute コンストラクタ (Boolean, Boolean)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

DataObjectFieldAttribute クラス新しインスタンス初期化しフィールドデータ行の主キーかどうかフィールドデータベースID フィールドかどうか示します

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

Public Sub New ( _
    primaryKey As Boolean, _
    isIdentity As Boolean _
)
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
)
public function DataObjectFieldAttribute (
    primaryKey : boolean, 
    isIdentity : boolean
)

パラメータ

primaryKey

フィールドデータ行の主キー含まれることを示す場合trueそれ以外場合false

isIdentity

フィールドデータ行を一意識別する ID フィールドであることを示す場合trueそれ以外場合false

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataObjectFieldAttribute クラス
DataObjectFieldAttribute メンバ
System.ComponentModel 名前空間

DataObjectFieldAttribute コンストラクタ (Boolean, Boolean, Boolean)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

DataObjectFieldAttribute クラス新しインスタンス初期化しフィールドデータ行の主キーかどうかフィールドデータベースID フィールドかどうかフィールドnull にできるかどうか示します

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

Public Sub New ( _
    primaryKey As Boolean, _
    isIdentity As Boolean, _
    isNullable As Boolean _
)
Dim primaryKey As Boolean
Dim isIdentity As Boolean
Dim isNullable As Boolean

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

パラメータ

primaryKey

フィールドデータ行の主キー含まれることを示す場合trueそれ以外場合false

isIdentity

フィールドデータ行を一意識別する ID フィールドであることを示す場合trueそれ以外場合false

isNullable

データ ストア内でフィールドnullできることを示す場合trueそれ以外場合false

使用例使用例

パブリック公開されプロパティDataObjectFieldAttribute適用しプロパティ関連付けられたメタデータ識別する方法次のコード例示します。この例では、NorthwindEmployee 型で、EmployeeIDFirstName、および LastName3 つのデータプロパティ公開します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; }
  }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataObjectFieldAttribute クラス
DataObjectFieldAttribute メンバ
System.ComponentModel 名前空間

DataObjectFieldAttribute コンストラクタ (Boolean, Boolean, Boolean, Int32)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

DataObjectFieldAttribute クラス新しインスタンス初期化しフィールドデータ行の主キーかどうかデータベースID フィールドかどうかnull にできるかどうか示しフィールド長さ設定します

名前空間: System.ComponentModel
アセンブリ: 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 (
    bool primaryKey,
    bool isIdentity,
    bool isNullable,
    int length
)
public:
DataObjectFieldAttribute (
    bool primaryKey, 
    bool isIdentity, 
    bool isNullable, 
    int length
)
public DataObjectFieldAttribute (
    boolean primaryKey, 
    boolean isIdentity, 
    boolean isNullable, 
    int length
)
public function DataObjectFieldAttribute (
    primaryKey : boolean, 
    isIdentity : boolean, 
    isNullable : boolean, 
    length : int
)

パラメータ

primaryKey

フィールドデータ行の主キー含まれることを示す場合trueそれ以外場合false

isIdentity

フィールドデータ行を一意識別する ID フィールドであることを示す場合trueそれ以外場合false

isNullable

データ ストア内でフィールドnullできることを示す場合trueそれ以外場合false

length

フィールド長さ (バイト単位)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataObjectFieldAttribute クラス
DataObjectFieldAttribute メンバ
System.ComponentModel 名前空間

DataObjectFieldAttribute コンストラクタ




英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DataObjectFieldAttribute コンストラクタ」の関連用語

DataObjectFieldAttribute コンストラクタのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataObjectFieldAttribute コンストラクタのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS