ObjectDataSourceStatusEventArgsとは? わかりやすく解説

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

ObjectDataSourceStatusEventArgs クラス

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

ObjectDataSource コントロールの Selected、Inserted、Updated、および Deleted の各イベントのデータを提供します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Class ObjectDataSourceStatusEventArgs
    Inherits EventArgs
Dim instance As ObjectDataSourceStatusEventArgs
public class ObjectDataSourceStatusEventArgs
 : EventArgs
public ref class ObjectDataSourceStatusEventArgs
 : public EventArgs
public class ObjectDataSourceStatusEventArgs
 extends EventArgs
public class ObjectDataSourceStatusEventArgs
 extends EventArgs
解説解説

ObjectDataSourceStatusEventArgs クラスは、出力パラメータ、戻り値、および ObjectDataSource コントロールが呼び出すメソッドによりスローされる例外へのアクセスを提供するために、OnSelected、OnUpdated、OnInserted、および OnDeleted メソッドで使用されます。これらにアクセスするのは、それぞれ OutputParameters、ReturnValue、および Exception プロパティです。Selected、Updated、Inserted、または Deleted イベントを処理するデリゲートを追加することで、このデータをチェックして、必要な追加のポスト プロセスを実行できます。

ObjectDataSource コントロールは、有効期間中、基になるビジネス オブジェクトを操作する際に利用できるイベントを数多く公開しています。イベント、および関連する EventArgs クラスとイベント ハンドラのデリゲートの一覧を次の表に示します。

イベント

イベント引数

イベント ハンドラ

ObjectCreating。

ビジネス オブジェクトのインスタンスが作成される直前に発生します。

ObjectDataSourceEventArgs

ObjectDataSourceObjectEventHandler

ObjectCreated。

ビジネス オブジェクトのインスタンスが作成された直後に発生します。

ObjectDataSourceEventArgs

ObjectDataSourceObjectEventHandler

Selecting。

データが取得される前に発生します。

ObjectDataSourceSelectingEventArgs

ObjectDataSourceSelectingEventHandler

Inserting、Updating、および Deleting。

挿入、更新、削除のいずれかの操作が実行される前に発生します。

ObjectDataSourceMethodEventArgs

ObjectDataSourceMethodEventHandler

Selected。

データが取得された後で発生します。

ObjectDataSourceStatusEventArgs

ObjectDataSourceStatusEventHandler

Inserted、Updated、および Deleted。

挿入、更新、削除のいずれかの操作が完了した後で発生します。

ObjectDataSourceStatusEventArgs

ObjectDataSourceStatusEventHandler

ObjectDisposing。

ビジネス オブジェクトが破棄される前に発生します。

ObjectDataSourceDisposingEventArgs

ObjectDataSourceDisposingEventHandler

使用例使用例

このセクションには、2 つのコード例が含まれています。ビジネス オブジェクトおよび GridView コントロールで、ObjectDataSource コントロールを使用してデータを削除する方法を、最初のコード例に示します。最初のコード例で使用した中間層ビジネス オブジェクトの例を 2 番目のコード例に示します。

ビジネス オブジェクトおよび GridView コントロールで、ObjectDataSource コントロールを使用してデータを削除する方法を次のコード例に示します。GridView は、SelectMethod プロパティによって指定されたメソッドで EmployeeLogic オブジェクトからデータを取得し、最初に全従業員を表示します。AutoGenerateDeleteButton プロパティが true に設定されているため、GridView コントロールは自動的に削除ボタンを表示します。

削除ボタンをクリックすると、DeleteMethod プロパティで指定されたメソッド、および DeleteParameters コレクションで指定されたパラメータを使用して Delete 操作が実行されます。このコード例では、従業員 ID に対応する DeleteParameters コレクションでパラメータが指定されます。これは、Columns コレクションに BoundField オブジェクトとして格納されている ID は、文字列として ObjectDataSource コントロールに渡されるからです。これを明示的に DeleteParameters コレクションに追加して、Type プロパティを Int32 値に設定することで、これは ObjectDataSource によって文字列ではなく整数として正しくメソッドに渡されます。

このコード例では、プリプロセスとポスト プロセスのステップも一部実行されます。NorthwindEmployeeDeleting デリゲートは、Delete 操作の実行前に Deleting イベントを処理するために呼び出されます。また、NorthwindEmployeeDeleted デリゲートは、Delete 操作の完了後に Deleted イベントを処理するために呼び出されます。これにより発生した例外が処理されます。NorthwindEmployeeDeleted デリゲートは、ObjectDataSourceStatusEventArgs オブジェクトを使用しているビジネス オブジェクトからスローされる対応可能な例外にアクセスします。この例では、NorthwindDataException がスローされた場合、このデリゲートによって処理されます。

<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB"
 Assembly="Samples.AspNet.VB"
 %>
<%@ Import namespace="Samples.AspNet.VB"
 %>
<%@ Page language="vb" %>
<Script runat="server">
' Called before a Delete operation.
    Private Sub NorthwindEmployeeDeleting(ByVal
 source As Object, ByVal
 e As ObjectDataSourceMethodEventArgs)

        ' The GridView passes the ID of the employee
        ' to be deleted. However, the business object, EmployeeLogic
,
        ' requires a NorthwindEmployee parameter, named "ne".
 Create
        ' it now and add it to the parameters collection.
        Dim paramsFromPage As IDictionary =
 e.InputParameters
  
        If Not paramsFromPage("EmpID")
 Is Nothing Then
    
            Dim ne As New
 NorthwindEmployee(paramsFromPage("EmpID").ToString())
            ' Remove the old EmpID parameter.
            paramsFromPage.Clear()
            paramsFromPage.Add("ne", ne)
    
    
        End If
    End Sub ' NorthwindEmployeeDeleting

    ' Called after a Delete operation.
    Private Sub NorthwindEmployeeDeleted(ByVal
 source As Object, ByVal
 e As ObjectDataSourceStatusEventArgs)
        ' Handle the Exception if it is a NorthwindDataException.
        If Not e.Exception Is
 Nothing Then

            ' Handle the specific exception type. The ObjectDataSource
 wraps
            ' any Exceptions in a TargetInvokationException wrapper,
 so
            ' check the InnerException property for the expected Exception
 types.
            If e.Exception.InnerException.GetType().Equals(GetType(NorthwindDataException))
 Then

                Label1.Text = e.Exception.InnerException.Message
                ' Because the exception is handled, there is
                ' no reason to throw it.
                e.ExceptionHandled = True
      
            End If
        End If
    End Sub ' NorthwindEmployeeDeleted
</Script>
<html>
  <head>
    <title>ObjectDataSource - VB Example</title>
  </head>
  <body>
    <form id="Form1" method="post"
 runat="server">

        <asp:gridview
          id="GridView1"
          runat="server"
          datasourceid="ObjectDataSource1"
          autogeneratedeletebutton="true"
          autogeneratecolumns="false"
          datakeynames="EmpID">
          <columns>
            <asp:boundfield headertext="EmpID"
 datafield="EmpID" />
            <asp:boundfield headertext="First Name"
 datafield="FirstName" />
            <asp:boundfield headertext="Last Name"
 datafield="LastName" />
          </columns>
        </asp:gridview>

        <asp:objectdatasource
          id="ObjectDataSource1"
          runat="server"
          selectmethod="GetAllEmployees"
          deletemethod="DeleteEmployee"
          ondeleting="NorthwindEmployeeDeleting"
          ondeleted="NorthwindEmployeeDeleted"
          typename="Samples.AspNet.VB.EmployeeLogic">
          <deleteparameters>
            <asp:parameter name="EmpID" type="Int32"
 />
          </deleteparameters>
        </asp:objectdatasource>

        <asp:label id="Label1" runat="server"
 />

    </form>
  </body>
</html>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS"
 Assembly="Samples.AspNet.CS" %>
<%@ Import namespace="Samples.AspNet.CS" %>
<%@ Page language="c#" %>
<Script runat="server">
private void NorthwindEmployeeDeleting(object
 source, ObjectDataSourceMethodEventArgs e)
{
  // The GridView passes the ID of the employee
  // to be deleted. However, the buisiness object, EmployeeLogic,
  // requires a NorthwindEmployee parameter, named "ne". Create
  // it now and add it to the parameters collection.
  IDictionary paramsFromPage = e.InputParameters;
  if (paramsFromPage["EmpID"] != null)
 {
    NorthwindEmployee ne
      = new NorthwindEmployee( Int32.Parse(paramsFromPage["EmpID"].ToString()));
    // Remove the old EmpID parameter.
    paramsFromPage.Clear();
    paramsFromPage.Add("ne", ne);
  }
}

private void NorthwindEmployeeDeleted(object
 source, ObjectDataSourceStatusEventArgs e)
{
  // Handle the Exception if it is a NorthwindDataException
  if (e.Exception != null)
  {

    // Handle the specific exception type. The ObjectDataSource wraps
    // any Exceptions in a TargetInvokationException wrapper, so
    // check the InnerException property for expected Exception types.
    if (e.Exception.InnerException is NorthwindDataException)
    {
      Label1.Text = e.Exception.InnerException.Message;
      // Because the exception is handled, there is
      // no reason to throw it.
      e.ExceptionHandled = true;
    }
  }
}

</Script>
<html>
  <head>
    <title>ObjectDataSource - C# Example</title>
  </head>
  <body>
    <form id="Form1" method="post" runat="server">

        <asp:gridview
          id="GridView1"
          runat="server"
          datasourceid="ObjectDataSource1"
          autogeneratedeletebutton="true"
          autogeneratecolumns="false"
          datakeynames="EmpID">
          <columns>
            <asp:boundfield headertext="EmpID" datafield="EmpID"
 />
            <asp:boundfield headertext="First Name" datafield="FirstName"
 />
            <asp:boundfield headertext="Last Name" datafield="LastName"
 />
          </columns>
        </asp:gridview>

        <asp:objectdatasource
          id="ObjectDataSource1"
          runat="server"
          selectmethod="GetAllEmployees"
          deletemethod="DeleteEmployee"
          ondeleting="NorthwindEmployeeDeleting"
          ondeleted="NorthwindEmployeeDeleted"
          typename="Samples.AspNet.CS.EmployeeLogic">
          <deleteparameters>
            <asp:parameter name="EmpID" type="Int32" />
          </deleteparameters>
        </asp:objectdatasource>

        <asp:label id="Label1" runat="server" />

    </form>
  </body>
</html>

前のコード例で使用した中間層ビジネス オブジェクトの例を、次のコード例に示します。次のリストは、このコード例で定義されている 2 つの主要なクラスの説明です。

便宜的に追加の NorthwindDataException クラスが提供されています。

これらのサンプル クラスは、Northwind Traders データベース (Microsoft SQL Server および Microsoft Access 製品に付属のサンプル データベース) を使用します。実際に動作させるためには、このコードをライブラリとしてコンパイルし、これらのクラスを ASP ページから使用する必要があります。前の例で提供した ASP ページを設定して、このクラス ライブラリを使用するようにします。UpdateEmployeeInfo メソッドは、完全には実装されていません。そのため、このサンプルを実行しても、Northwind Traders データベースにデータは挿入されません。

Imports System
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace Samples.AspNet.VB
'
' EmployeeLogic is a stateless business object that encapsulates
' the operations you can perform on a NorthwindEmployee object.
Public Class EmployeeLogic

   ' Return a collection of NorthwindEmployee objects.
   Public Shared Function
 GetAllEmployees() As ICollection
      Dim al As New ArrayList()

      ' Use the SqlDataSource class to wrap the
      ' ADO.NET code required to query the database.
      Dim cts As ConnectionStringSettings =
 ConfigurationManager.ConnectionStrings("NorthwindConnection")
      Dim sds As New SqlDataSource(cts.ConnectionString,
 _
                                  "SELECT EmployeeID FROM Employees")
      Try
         Dim IDs As IEnumerable = sds.Select(DataSourceSelectArguments.Empty)

         ' Iterate through the Enumeration and create a
         ' NorthwindEmployee object for each ID.
         Dim enumerator As IEnumerator = IDs.GetEnumerator()
         While enumerator.MoveNext()
            ' The IEnumerable contains DataRowView objects.
            Dim row As DataRowView = CType(enumerator.Current
,DataRowView)
            Dim id As String
 = row("EmployeeID").ToString()
            Dim nwe As New
 NorthwindEmployee(id)
            ' Add the NorthwindEmployee object to the collection.
            al.Add(nwe)
         End While
      Finally
         ' If anything strange happens, clean up.
         sds.Dispose()
      End Try

      Return al
   End Function 'GetAllEmployees


   Public Shared Function
 GetEmployee(anID As Object) As
 NorthwindEmployee
      Return New NorthwindEmployee(anID)
   End Function 'GetEmployee


   Public Shared Sub DeleteEmployee(ne
 As NorthwindEmployee)
      Dim retval As Boolean
 = ne.Delete()
      If Not retval Then
         Throw New NorthwindDataException("Employee
 delete failed.")
      End If ' Delete the object
 in memory.
      ne = Nothing
   End Sub 'DeleteEmployee


   Public Shared Sub DeleteEmployeeByID(anID
 As Integer)
      Dim tempEmp As New
 NorthwindEmployee(anID)
      DeleteEmployee(tempEmp)
   End Sub 'DeleteEmployeeByID

End Class 'EmployeeLogic

Public Class NorthwindEmployee

   Public Sub New()
      ID = DBNull.Value
      aLastName = ""
      aFirstName = ""
   End Sub 'New


   Public Sub New(anID As
 Object)
      Me.ID = anID
      Dim cts As ConnectionStringSettings =
 ConfigurationManager.ConnectionStrings("NorthwindConnection")
      Dim conn As New SqlConnection(cts.ConnectionString)
      Dim sc As New SqlCommand("
 SELECT FirstName,LastName " & _
                               " FROM Employees "
 & _
                               " WHERE EmployeeID = @empId",
 conn)
      ' Add the employee ID parameter and set its value.
      sc.Parameters.Add(New SqlParameter("@empId",
 SqlDbType.Int)).Value = Int32.Parse(anID.ToString())
      Dim sdr As SqlDataReader = Nothing

      Try
         conn.Open()
         sdr = sc.ExecuteReader()

         ' This is not a while loop. It only loops once.
         If Not (sdr Is
 Nothing) AndAlso sdr.Read() Then
            ' The IEnumerable contains DataRowView objects.
            Me.aFirstName = sdr("FirstName").ToString()
            Me.aLastName = sdr("LastName").ToString()
         Else
            Throw New NorthwindDataException("Data
 not loaded for employee id.")
         End If
      Finally
         Try
            If Not (sdr Is
 Nothing) Then
               sdr.Close()
            End If
            conn.Close()
         Catch se As SqlException
            ' Log an event in the Application Event Log.
            Throw
         End Try
      End Try
   End Sub 'New

   Private ID As Object
   Public ReadOnly Property
 EmpID() As Object
      Get
         Return ID
      End Get
   End Property

   Private aLastName As String
   Public Property LastName() As
 String
      Get
         Return aLastName
      End Get
      Set
         aLastName = value
      End Set
   End Property

   Private aFirstName As String
   Public Property FirstName() As
 String
      Get
         Return aFirstName
      End Get
      Set
         aFirstName = value
      End Set
   End Property

   Public Function Delete() As
 Boolean
      If ID.Equals(DBNull.Value) Then
         ' The Employee object is not persisted.
         Return True
      Else
         ' The Employee object is persisted.
         ' Use the SqlDataSource control as a convenient wrapper for
         ' the ADO.NET code needed to delete a record from the database.
         Dim cts As ConnectionStringSettings =
 ConfigurationManager.ConnectionStrings("NorthwindConnection")
         Dim sds As New
 SqlDataSource()
         Try
            sds.ConnectionString = cts.ConnectionString
            sds.DeleteCommand = "DELETE FROM Employees WHERE EmployeeID=@empID"
            sds.DeleteParameters.Add(New Parameter("empID",
 TypeCode.Int32, Me.ID.ToString()))

            ' Implement the remainder of the Delete() method.
            '
            Throw New NorthwindDataException("Delete()
 method not completely implemented.")

            Return True
         Finally
            ' Clean up resources.
            sds.Dispose()
         End Try
      End If
   End Function 'Delete
End Class 'NorthwindEmployee

Public Class NorthwindDataException
   Inherits Exception

   Public Sub New(msg As
 String)
      MyBase.New(msg)
   End Sub 'New

End Class 'NorthwindDataException
End Namespace
namespace Samples.AspNet.CS {

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls;
  //
  // EmployeeLogic is a stateless business object that encapsulates
  // the operations you can perform on a NorthwindEmployee object.
  //
  public class EmployeeLogic {

    // Returns a collection of NorthwindEmployee objects.
    public static ICollection GetAllEmployees
 () {
      ArrayList al = new ArrayList();

      // Use the SqlDataSource class to wrap the
      // ADO.NET code required to query the database.
      ConnectionStringSettings cts = ConfigurationManager.ConnectionStrings["NorthwindConnection"];

      SqlDataSource sds
        = new SqlDataSource(cts.ConnectionString,
                            "SELECT EmployeeID FROM Employees");
      try {
        IEnumerable IDs = sds.Select(DataSourceSelectArguments.Empty);

        // Iterate through the Enumeration and create a
        // NorthwindEmployee object for each ID.
        IEnumerator enumerator = IDs.GetEnumerator();
        while (enumerator.MoveNext()) {
          // The IEnumerable contains DataRowView objects.
          DataRowView row = enumerator.Current as DataRowView;
          string id = row["EmployeeID"].ToString();
          NorthwindEmployee nwe = new NorthwindEmployee(id);
          // Add the NorthwindEmployee object to the collection.
          al.Add(nwe);
        }
      }
      finally {
        // If anything strange happens, clean up.
        sds.Dispose();
      }

      return al;
    }

    public static NorthwindEmployee GetEmployee(object
 anID) {
      return new NorthwindEmployee(anID);
    }

    public static void DeleteEmployee(NorthwindEmployee
 ne) {
      bool retval = ne.Delete();
      if (! retval) { throw new NorthwindDataException("Employee
 delete failed."); }
      // Delete the object in memory.
      ne = null;
    }

    public static void DeleteEmployeeByID(int
 anID) {
        NorthwindEmployee tempEmp = new NorthwindEmployee(anID);
        DeleteEmployee(tempEmp);
    }
  }

  public class NorthwindEmployee {

    public NorthwindEmployee () {
      ID = DBNull.Value;
      lastName = "";
      firstName = "";
    }

    public NorthwindEmployee (object anID) {
      this.ID = anID;

      ConnectionStringSettings cts = ConfigurationManager.ConnectionStrings["NorthwindConnection"];

      SqlConnection conn = new SqlConnection (cts.ConnectionString);
      SqlCommand sc =
        new SqlCommand(" SELECT FirstName,LastName "
 +
                       " FROM Employees " +
                       " WHERE EmployeeID = @empId",
                       conn);
      // Add the employee ID parameter and set its value.
      sc.Parameters.Add(new SqlParameter("@empId",SqlDbType.Int)).Value
 = Int32.Parse(anID.ToString());
      SqlDataReader sdr = null;

      try {
        conn.Open();
        sdr = sc.ExecuteReader();

        // This is not a while loop. It only loops once.
        if (sdr != null && sdr.Read())
 {
          // The IEnumerable contains DataRowView objects.
          this.firstName        = sdr["FirstName"].ToString();
          this.lastName         = sdr["LastName"].ToString();
        }
        else {
          throw new NorthwindDataException("Data not loaded
 for employee id.");
        }
      }
      finally {
        try {
          if (sdr != null) sdr.Close();
          conn.Close();
        }
        catch (SqlException) {
          // Log an event in the Application Event Log.
          throw;
        }
      }
    }

    private object ID;
    public object EmpID {
      get { return ID; }
    }

    private string lastName;
    public string LastName {
      get { return lastName; }
      set { lastName = value; }
    }

    private string firstName;
    public string FirstName {
      get { return firstName; }
      set { firstName = value;  }
    }
    public bool Delete () {
      if (ID.Equals(DBNull.Value)) {
        // The Employee object is not persisted.
        return true;
      }
      else {
        // The Employee object is persisted.
        // Use the SqlDataSource control as a convenient wrapper for
        // the ADO.NET code needed to delete a record from the database.
        ConnectionStringSettings cts = ConfigurationManager.ConnectionStrings["NorthwindConnection"];
        SqlDataSource sds = new SqlDataSource();

        try {
          sds.ConnectionString = cts.ConnectionString;
          sds.DeleteCommand = "DELETE FROM Employees WHERE EmployeeID=@empID";
          sds.DeleteParameters.Add(new Parameter("empID"
,TypeCode.Int32,this.ID.ToString()));

          //
          // Implement the remainder of the Delete() method.
          //
          throw new NorthwindDataException("Delete() method
 not completely implemented.");
        }
        finally {
          // Clean up resources.
          sds.Dispose();
        }
      }
    }
  }

  public class NorthwindDataException: Exception
 {
    public NorthwindDataException(string msg)
 : base (msg) { }
  }
}
.NET Framework のセキュリティ.NET Framework のセキュリティ
継承階層継承階層
System.Object
   System.EventArgs
    System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ObjectDataSourceStatusEventArgs メンバ
System.Web.UI.WebControls 名前空間
ObjectDataSource クラス

ObjectDataSourceStatusEventArgs コンストラクタ (Object, IDictionary)

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

指定された出力パラメータと戻り値を使用して、ObjectDataSourceStatusEventArgs クラスの新しいインスタンスを初期化します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    returnValue As Object, _
    outputParameters As IDictionary _
)
Dim returnValue As Object
Dim outputParameters As IDictionary

Dim instance As New ObjectDataSourceStatusEventArgs(returnValue,
 outputParameters)
public ObjectDataSourceStatusEventArgs (
    Object returnValue,
    IDictionary outputParameters
)
public:
ObjectDataSourceStatusEventArgs (
    Object^ returnValue, 
    IDictionary^ outputParameters
)
public ObjectDataSourceStatusEventArgs (
    Object returnValue, 
    IDictionary outputParameters
)
public function ObjectDataSourceStatusEventArgs
 (
    returnValue : Object, 
    outputParameters : IDictionary
)

パラメータ

returnValue

データベース操作の完了時に返される戻り値を示すオブジェクト。

outputParameters

名前/値ペアのパラメータ オブジェクトである IDictionary。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ObjectDataSourceStatusEventArgs クラス
ObjectDataSourceStatusEventArgs メンバ
System.Web.UI.WebControls 名前空間
OutputParameters
ReturnValue

ObjectDataSourceStatusEventArgs コンストラクタ

ObjectDataSourceStatusEventArgs クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
ObjectDataSourceStatusEventArgs (Object, IDictionary) 指定された出力パラメータと戻り値を使用して、ObjectDataSourceStatusEventArgs クラスの新しいインスタンスを初期化します。
ObjectDataSourceStatusEventArgs (Object, IDictionary, Exception) 指定された出力パラメータ、戻り値、および例外を使用して、ObjectDataSourceStatusEventArgs クラスの新しいインスタンスを初期化します。
参照参照

関連項目

ObjectDataSourceStatusEventArgs クラス
ObjectDataSourceStatusEventArgs メンバ
System.Web.UI.WebControls 名前空間
OutputParameters
ReturnValue

ObjectDataSourceStatusEventArgs コンストラクタ (Object, IDictionary, Exception)

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

指定された出力パラメータ、戻り値、および例外を使用して、ObjectDataSourceStatusEventArgs クラスの新しいインスタンスを初期化します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    returnValue As Object, _
    outputParameters As IDictionary, _
    exception As Exception _
)
Dim returnValue As Object
Dim outputParameters As IDictionary
Dim exception As Exception

Dim instance As New ObjectDataSourceStatusEventArgs(returnValue,
 outputParameters, exception)
public ObjectDataSourceStatusEventArgs (
    Object returnValue,
    IDictionary outputParameters,
    Exception exception
)
public:
ObjectDataSourceStatusEventArgs (
    Object^ returnValue, 
    IDictionary^ outputParameters, 
    Exception^ exception
)
public ObjectDataSourceStatusEventArgs (
    Object returnValue, 
    IDictionary outputParameters, 
    Exception exception
)
public function ObjectDataSourceStatusEventArgs
 (
    returnValue : Object, 
    outputParameters : IDictionary, 
    exception : Exception
)

パラメータ

returnValue

データベース操作の完了時に返される戻り値を示すオブジェクト。

outputParameters

名前/値ペアのパラメータ オブジェクトである IDictionary。

exception

メソッドの呼び出し中にスローされた内部例外をラップした Exception。

解説解説

returnValue パラメータには、ビジネス オブジェクトのデータ メソッドを呼び出したときに返される各種のオブジェクトを指定します。outputParameters パラメータには、名前/値ペアの IDictionary コレクションを指定します。これらの名前/値ペアはメソッド シグネチャに適合している必要があります。またこれらは参照で渡されます。exception パラメータには、Exception 例外を指定します。この例外には、データ操作中に ObjectDataSource コントロールが呼び出すメソッドによりスローされる例外をラップします。例外が OnSelected、OnUpdated、OnInserted、または OnDeleted メソッドにより処理されない場合は、データ操作の復帰後に ObjectDataSource コントロールによりその例外がスローされます。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ObjectDataSourceStatusEventArgs クラス
ObjectDataSourceStatusEventArgs メンバ
System.Web.UI.WebControls 名前空間
OutputParameters
ReturnValue
Exception
ExceptionHandled

ObjectDataSourceStatusEventArgs プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

ObjectDataSourceStatusEventArgs クラス
System.Web.UI.WebControls 名前空間
ObjectDataSource クラス

ObjectDataSourceStatusEventArgs メソッド


ObjectDataSourceStatusEventArgs メンバ

ObjectDataSource コントロールの Selected、Inserted、Updated、および Deleted の各イベントのデータを提供します。

ObjectDataSourceStatusEventArgs データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ObjectDataSourceStatusEventArgs オーバーロードされます。 ObjectDataSourceStatusEventArgs クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ObjectDataSourceStatusEventArgs クラス
System.Web.UI.WebControls 名前空間
ObjectDataSource クラス



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「ObjectDataSourceStatusEventArgs」の関連用語

ObjectDataSourceStatusEventArgsのお隣キーワード
検索ランキング

   

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



ObjectDataSourceStatusEventArgsのページの著作権

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

©2026 GRAS Group, Inc.RSS