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


DataObjectAttribute(Boolean) コンストラクタを使用して、ObjectDataSourceDesigner クラスなどのデザイン時クラスに対して、あるオブジェクトを ObjectDataSource オブジェクトへのバインドに適したオブジェクトの一覧から除外する必要があることを示します。

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


DataObjectAttribute コンストラクタ

名前 | 説明 |
---|---|
DataObjectAttribute () | DataObjectAttribute クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
DataObjectAttribute (Boolean) | DataObjectAttribute クラスの新しいインスタンスを初期化し、オブジェクトが ObjectDataSource オブジェクトへのバインドに適しているかどうかを示します。 .NET Compact Framework によってサポートされています。 |

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



DataObjectAttribute コンストラクタを使用するコード例を次に示します。
<DataObjectAttribute()> _ Public Class NorthwindData <DataObjectMethodAttribute(DataObjectMethodType.Select, True)> _ Public Shared Function GetAllEmployees() As IEnumerable Dim ads As New AccessDataSource() ads.DataSourceMode = SqlDataSourceMode.DataReader ads.DataFile = "~/App_Data/Northwind.mdb" ads.SelectCommand = "SELECT EmployeeID,FirstName,LastName FROM Employees" Return ads.Select(DataSourceSelectArguments.Empty) End Function 'GetAllEmployees ' Delete the Employee by ID. <DataObjectMethodAttribute(DataObjectMethodType.Delete, True)> _ Public Sub DeleteEmployeeByID(ByVal employeeID As Integer) Throw New Exception("The value passed to the delete method is " + employeeID.ToString()) End Sub 'DeleteEmployeeByID End Class 'NorthwindData
[DataObjectAttribute] public class NorthwindData { public NorthwindData() {} [DataObjectMethodAttribute(DataObjectMethodType.Select, true)] public static IEnumerable GetAllEmployees() { AccessDataSource ads = new AccessDataSource(); ads.DataSourceMode = SqlDataSourceMode.DataReader; ads.DataFile = "~//App_Data//Northwind.mdb"; ads.SelectCommand = "SELECT EmployeeID,FirstName,LastName FROM Employees"; return ads.Select(DataSourceSelectArguments.Empty); } // Delete the Employee by ID. [DataObjectMethodAttribute(DataObjectMethodType.Delete, true)] public void DeleteEmployeeByID(int employeeID) { throw new Exception("The value passed to the delete method is " + employeeID.ToString()); } }

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


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