OracleDataAdapter Constructor ()

Initializes a new instance of the OracleDataAdapter class.

Namespace: System.Data.OracleClient
Assembly: System.Data.OracleClient (in

public OracleDataAdapter ()
public OracleDataAdapter ()
public function OracleDataAdapter ()

When you create an instance of OracleDataAdapter, the following read/write properties are set to their default values, as shown in the table.


Default value





You can change the value of any of these properties through a separate call to the property.

The following example creates an OracleDataAdapter and sets some of its properties.

[Visual Basic]

Public Sub CreateOracleDataAdapter()
    Dim myOracleConnection As OracleConnection = New OracleConnection("Data Source=Oracle8i;Integrated Security=yes")
    Dim custDA As OracleDataAdapter = New OracleDataAdapter
    custDA.MissingSchemaAction = MissingSchemaAction.AddWithKey
    custDA.SelectCommand = New OracleCommand("SELECT DeptNo, DName FROM Dept", myOracleConnection)
    custDA.InsertCommand = New OracleCommand("INSERT INTO Dept (DeptNo, DName) " & _
                                            "VALUES (:pDeptNo, :pDName)", myOracleConnection)
    custDA.UpdateCommand = New OracleCommand("UPDATE Dept SET DeptNo = :pDeptNo, DName = :pDName " & _
                                            "WHERE DeptNo = :pDeptNo", myOracleConnection)
    custDA.DeleteCommand = New OracleCommand("DELETE FROM Dept WHERE DeptNo = :pDeptNo", myOracleConnection)

    custDA.InsertCommand.Parameters.Add("pDeptNo", OracleType.Number, 2, "DeptNo")
    custDA.InsertCommand.Parameters.Add("pDName", OracleType.VarChar, 14, "DName")
    custDA.UpdateCommand.Parameters.Add("pDeptNo", OracleType.Number, 2, "DeptNo")
    custDA.UpdateCommand.Parameters.Add("pDName", OracleType.VarChar, 14, "DName")
    custDA.UpdateCommand.Parameters.Add("poldDeptNo", OracleType.Number, 2, "DeptNo").SourceVersion = DataRowVersion.Original

    custDA.DeleteCommand.Parameters.Add("pDeptNo", OracleType.Number, 2, "DeptNo").SourceVersion = DataRowVersion.Original
End Sub


public static void CreateOracleDataAdapter() 
    OracleConnection myOracleConnection = new OracleConnection("Data Source=Oracle8i;Integrated Security=yes");
    OracleDataAdapter custDA = new OracleDataAdapter();
    custDA.MissingSchemaAction = MissingSchemaAction.AddWithKey;
    custDA.SelectCommand = new OracleCommand("SELECT DeptNo, CompanyName FROM Dept", myOracleConnection);
    custDA.InsertCommand = new OracleCommand("INSERT INTO Dept (DeptNo, CompanyName) " +
                                            "VALUES (:pDeptNo, :pCompanyName)", myOracleConnection);
    custDA.UpdateCommand = new OracleCommand("UPDATE Dept SET DeptNo = :pDeptNo, CompanyName = :pCompanyName " +
                                            "WHERE DeptNo = :pDeptNo", myOracleConnection);
    custDA.DeleteCommand = new OracleCommand("DELETE FROM Dept WHERE DeptNo = :pDeptNo", myOracleConnection);

    custDA.InsertCommand.Parameters.Add("pDeptNo", OracleType.Number, 2, "DeptNo");
    custDA.InsertCommand.Parameters.Add("pCompanyName", OracleType.VarChar, 14, "CompanyName");
    custDA.UpdateCommand.Parameters.Add("pDeptNo", OracleType.Number, 2, "DeptNo");
    custDA.UpdateCommand.Parameters.Add("pCompanyName", OracleType.VarChar, 14, "CompanyName");
    custDA.UpdateCommand.Parameters.Add("poldDeptNo", OracleType.Number, 2, "DeptNo").SourceVersion = DataRowVersion.Original;

    custDA.DeleteCommand.Parameters.Add("pDeptNo", OracleType.Number, 2, "DeptNo").SourceVersion = DataRowVersion.Original;

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1

Community Additions