ObjectDataSourceStatusEventArgs 클래스

정의

Selected 컨트롤의 Inserted, Updated, DeletedObjectDataSource 이벤트에 대한 데이터를 제공합니다.Provides data for the Selected, Inserted, Updated, and Deleted events of the ObjectDataSource control.

public ref class ObjectDataSourceStatusEventArgs : EventArgs
public class ObjectDataSourceStatusEventArgs : EventArgs
type ObjectDataSourceStatusEventArgs = class
    inherit EventArgs
Public Class ObjectDataSourceStatusEventArgs
Inherits EventArgs
상속
ObjectDataSourceStatusEventArgs

예제

이 섹션에는 두 코드 예제가 있습니다.This section contains two code examples. 첫 번째 코드 예제에 사용 하는 방법을 보여 줍니다.는 ObjectDataSource 비즈니스 개체를 사용 하 여 컨트롤 및 GridView 컨트롤 데이터를 삭제 합니다.The first code example demonstrates how to use an ObjectDataSource control with a business object and a GridView control to delete data. 두 번째 코드 예제에서는 첫 번째 코드 예제를 사용 하는 예제에서는 중간 계층 비즈니스 개체를 제공 합니다.The second code example provides an example middle-tier business object that the first code example uses.

다음 코드 예제에 사용 하는 방법을 보여 줍니다.는 ObjectDataSource 비즈니스 개체를 사용 하 여 컨트롤 및 GridView 컨트롤 데이터를 삭제 합니다.The following code example demonstrates how to use an ObjectDataSource control with a business object and a GridView control to delete data. GridView 처음에 지정 된 메서드를 사용 하 여 모든 직원의 집합을 표시 합니다 SelectMethod 속성에서 데이터를 검색 하는 EmployeeLogic 개체.The GridView initially displays a set of all employees, using the method that is specified by the SelectMethod property to retrieve the data from the EmployeeLogic object. 때문에 AutoGenerateDeleteButton 속성이 trueGridView 컨트롤이 자동으로 표시를 삭제 단추입니다.Because the AutoGenerateDeleteButton property is set to true, the GridView control automatically displays a Delete button.

클릭할 경우는 삭제 단추를를 Delete 작업으로 지정 된 메서드를 사용 하 여 수행 됩니다는 DeleteMethod 속성 및 지정 된 매개 변수는 DeleteParameters 컬렉션.If you click the Delete button, the Delete action is performed using the method that is specified by the DeleteMethod property and any parameters that are specified in the DeleteParameters collection. 이 코드 예제에서는 하나의 매개 변수는에 지정 된 된 DeleteParameters 직원 ID에 해당 하는 컬렉션In this code example, one parameter is specified in the DeleteParameters collection that corresponds to the employee ID. 때문에 이것이 ID에 포함 되어 있어도 합니다 Columns 컬렉션으로를 BoundField 개체에 문자열로 전달 됩니다는 ObjectDataSource 컨트롤입니다.This is because although the ID is included in the Columns collection as a BoundField object, it will be passed as a string to the ObjectDataSource control. 명시적으로 추가 하 여는 DeleteParameters 사용 하 여 컬렉션을 Type 속성이로 설정는 Int32 값을 전달 합니다에서 올바르게는 ObjectDataSource 문자열이 아닌 정수로 방법.By adding it explicitly to the DeleteParameters collection with a Type property set to the Int32 value, it will pass correctly by the ObjectDataSource to the method as an integer, rather than as string.

이 코드 예제에서는 몇 가지 전처리 및 후 처리 단계도 수행 됩니다.In this code example, some preprocessing and post-processing steps are also performed. NorthwindEmployeeDeleting 대리자를 처리 하기 위해 호출 됩니다는 Deleting 되기 전, 이벤트를 Delete 작업이 수행 될 및 NorthwindEmployeeDeleted 대리자를 처리 하기 위해 호출 됩니다는 Deleted 후 이벤트를 Delete 작업 완료를 처리 하려는 예외 발생 했을 수입니다.The NorthwindEmployeeDeleting delegate is called to handle the Deleting event before the Delete action is performed, and the NorthwindEmployeeDeleted delegate is called to handle the Deleted event after the Delete action has completed, to handle any exceptions that might have occurred. 합니다 NorthwindEmployeeDeleted 대리자를 사용 하는 비즈니스 개체에서 throw 된 예외에 액세스 하는 ObjectDataSourceStatusEventArgs 개체입니다.The NorthwindEmployeeDeleted delegate accesses possible exceptions that are thrown by the business object that is using the ObjectDataSourceStatusEventArgs object. 이 예제의 경우는 NorthwindDataException 는이 대리자에 의해 처리 됩니다 throw 합니다.In this example, if a NorthwindDataException is thrown, it is handled by this delegate.

<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS" Assembly="Samples.AspNet.CS" %>
<%@ Import namespace="Samples.AspNet.CS" %>
<%@ Page language="c#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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 xmlns="http://www.w3.org/1999/xhtml" >
  <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>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB" Assembly="Samples.AspNet.VB" %>
<%@ Import namespace="Samples.AspNet.VB" %>
<%@ Page language="vb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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 xmlns="http://www.w3.org/1999/xhtml" >
  <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>

다음 코드 예제에서는 앞의 코드 예제를 사용 하는 예제에서는 중간 계층 비즈니스 개체를 제공 합니다.The following code example provides an example middle-tier business object that the preceding code example uses. 다음은 코드 예제에 정의 된 두 개의 주요 클래스를 설명 합니다.The following list describes the two major classes that are defined in the code example:

  • EmployeeLogic 클래스는 상태를 유지 하지 않습니다 하 고 비즈니스 논리를 캡슐화 하는 클래스입니다.The EmployeeLogic class is a class that does not maintain state and encapsulates business logic.

  • NorthwindEmployee 클래스는 로드 하 고 데이터 계층에서 데이터를 유지 하는 데 필요한 기본적인 기능만 포함 하는 모델 클래스입니다.The NorthwindEmployee class is a model class that contains only the basic functionality that is required to load and persist data from the data tier.

또한는 NorthwindDataException 클래스는 편의 위해 제공 됩니다.In addition, a NorthwindDataException class is provided as a convenience.

이 예제에서는 클래스이 집합을 Microsoft SQL Server 및 Microsoft Access를 사용 하 여 사용할 수 있는 예제 데이터베이스는 Northwind Traders 데이터베이스를 사용 합니다.This set of example classes uses the Northwind Traders database, which is an example database that is available with Microsoft SQL Server and Microsoft Access. 전체 작업 예제를 보려면이 코드를 라이브러리로 컴파일하고 ASP 페이지에서 이러한 클래스를 사용 합니다.For a complete working example, you must compile this code as a library, and then use these classes from an ASP page. 앞의 예제에서 제공 되는 ASP 페이지는이 클래스 라이브러리와 함께 작동 하도록 구성 됩니다.The ASP page that is provided in the preceding example is configured to work with this class library. UpdateEmployeeInfo 메서드 구현 되지 않은 완전히 하지 삽입할 데이터 Northwind Traders 데이터베이스이 예제를 테스트할 때 있도록 합니다.The UpdateEmployeeInfo method is not completely implemented, so you will not insert data into the Northwind Traders database when you experiment with this example.

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.DeleteParameters.Add(new Parameter("empID", TypeCode.Int32, this.ID.ToString()));
          sds.DeleteCommand = "DELETE FROM [Order Details] " + 
              "WHERE OrderID IN (SELECT OrderID FROM Orders WHERE EmployeeID=@empID)";
          sds.Delete();
          sds.DeleteCommand = "DELETE FROM Orders WHERE EmployeeID=@empID";
          sds.Delete();
          sds.DeleteCommand = "DELETE FROM EmployeeTerritories WHERE EmployeeID=@empID";
          sds.Delete();
          sds.DeleteCommand = "DELETE FROM Employees WHERE EmployeeID=@empID";
          sds.Delete();
          return true;
        }
        finally {
          // Clean up resources.
          sds.Dispose();
        }
      }
    }
  }

  public class NorthwindDataException: Exception {
    public NorthwindDataException(string msg) : base (msg) { }
  }
}
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


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

End Class

Public Class NorthwindEmployee

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


   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

   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.DeleteParameters.Add(New Parameter("empID", TypeCode.Int32, Me.ID.ToString()))
            sds.DeleteCommand = "DELETE FROM [Order Details] " & _
                "WHERE OrderID IN (SELECT OrderID FROM Orders WHERE EmployeeID=@empID)"
            sds.Delete()
            sds.DeleteCommand = "DELETE FROM Orders WHERE EmployeeID=@empID"
            sds.Delete()
            sds.DeleteCommand = "DELETE FROM EmployeeTerritories WHERE EmployeeID=@empID"
            sds.Delete()
            sds.DeleteCommand = "DELETE FROM Employees WHERE EmployeeID=@empID"
            sds.Delete()
            Return True
         Finally
            ' Clean up resources.
            sds.Dispose()
         End Try
      End If
   End Function 'Delete
End Class

Public Class NorthwindDataException
   Inherits Exception

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

End Class
End Namespace

설명

ObjectDataSourceStatusEventArgs 클래스에서 사용 됩니다 합니다 OnSelected, OnUpdated, OnInserted, 및 OnDeleted 출력 매개 변수, 반환 값 및 호출 하는 메서드에서 throw 되는 예외에 대 한 액세스를 제공 하는 메서드는 ObjectDataSource 컨트롤입니다.The ObjectDataSourceStatusEventArgs class is used in the OnSelected, OnUpdated, OnInserted, and OnDeleted methods to provide access to output parameters, return values, and exceptions that are thrown by the method that is called by the ObjectDataSource control. 액세스 하는 이러한 합니다 OutputParameters, ReturnValue, 및 Exception 속성을 각각.These are accessed by the OutputParameters, ReturnValue, and Exception properties, respectively. 처리 하는 대리자를 추가 하 여 합니다 Selected, UpdatedInserted, 또는 Deleted 이벤트를이 데이터를 검사 하 고 필요한 모든 추가 사후 처리를 수행할 수 있습니다.By adding a delegate to handle the Selected, Updated, Inserted, or Deleted events, you can examine this data and perform any additional post processing that is required.

ObjectDataSource 컨트롤 수명 주기에서 다양 한 시간에 기본 비즈니스 개체를 사용 하 여 작업을 처리할 수 있는 많은 이벤트를 노출 합니다.The ObjectDataSource control exposes many events that you can handle to work with the underlying business object at various times in its lifecycle. 다음 표에서 이벤트와 연결 된 EventArgs 클래스 및 이벤트 처리기 대리자입니다.The following table lists the events and the associated EventArgs classes and event handler delegates.

이벤트Event EventArgsEventArgs 이벤트 처리기EventHandler
ObjectCreating.ObjectCreating.

비즈니스 개체의 인스턴스가 만들어질 직전에 발생 합니다.Occurs immediately before the instance of the business object is created.
ObjectDataSourceEventArgs ObjectDataSourceObjectEventHandler
ObjectCreated.ObjectCreated.

비즈니스 개체의 인스턴스를 만든 직후에 발생 합니다.Occurs immediately after the instance of the business object is created.
ObjectDataSourceEventArgs ObjectDataSourceObjectEventHandler
Selecting.Selecting.

데이터를 검색 하기 전에 발생 합니다.Occurs before the data is retrieved.
ObjectDataSourceSelectingEventArgs ObjectDataSourceSelectingEventHandler
Inserting, UpdatingDeletingInserting, Updating, and Deleting.

삽입, 업데이트 또는 삭제 작업을 수행 하기 전에 발생 합니다.Occur before an insert, update, or delete operation is performed.
ObjectDataSourceMethodEventArgs ObjectDataSourceMethodEventHandler
Selected.Selected.

데이터를 검색 한 후에 발생 합니다.Occurs after the data is retrieved.
ObjectDataSourceStatusEventArgs ObjectDataSourceStatusEventHandler
Inserted, UpdatedDeletedInserted, Updated, and Deleted.

삽입, 업데이트 또는 삭제 작업이 완료 되 면 발생 합니다.Occur after the insert, update, or delete operation is completed.
ObjectDataSourceStatusEventArgs ObjectDataSourceStatusEventHandler
ObjectDisposing.ObjectDisposing.

비즈니스 개체를 제거 하기 전에 발생 합니다.Occurs before a business object is destroyed.
ObjectDataSourceDisposingEventArgs ObjectDataSourceDisposingEventHandler

생성자

ObjectDataSourceStatusEventArgs(Object, IDictionary)

지정된 출력 매개 변수와 반환 값을 사용하여 ObjectDataSourceStatusEventArgs 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ObjectDataSourceStatusEventArgs class using the specified output parameters and return value.

ObjectDataSourceStatusEventArgs(Object, IDictionary, Exception)

지정된 출력 매개 변수, 반환 값 및 예외를 사용하여 ObjectDataSourceStatusEventArgs 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ObjectDataSourceStatusEventArgs class using the specified output parameters, return value, and exception.

속성

AffectedRows

데이터 작업의 영향을 받은 행의 수를 가져오거나 설정합니다.Gets or sets the number of rows that are affected by the data operation.

Exception

데이터 작업 중에 ObjectDataSource 컨트롤에서 호출된 메서드가 throw한 모든 예외의 래퍼를 가져옵니다.Gets a wrapper for any exceptions that are thrown by the method that is called by the ObjectDataSource control during a data operation.

ExceptionHandled

비즈니스 개체에서 throw된 예외가 처리되었는지 여부를 나타내는 값을 가져오거나 설정합니다.Gets or sets a value indicating whether an exception that was thrown by the business object has been handled.

OutputParameters

비즈니스 개체 메서드 매개 변수와 해당 값이 들어 있는 컬렉션을 가져옵니다.Gets a collection that contains business object method parameters and their values.

ReturnValue

비즈니스 개체 메서드에서 반환된 값이 있는 경우 해당 값을 개체로 가져옵니다.Gets the return value that is returned by the business object method, if any, as an object.

메서드

Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(다음에서 상속됨 Object)

적용 대상

추가 정보