Creates and returns a
OracleCommand object associated with the
OracleConnection.
In this sample
OracleCommand object is created. It is automatically associated with
OracleConnection that created it.
|
|---|
public void CreateOracleCommand(string myConnString)
{
OracleConnection oracleConnection = new OracleConnection(myConnString);
OracleCommand oracleCommand = oracleConnection.CreateCommand();
oracleCommand.CommandText = "INSERT INTO DEPT VALUES (50,'Development','Philadelphia')";
oracleConnection.Open();
try
{
oracleCommand.ExecuteNonQuery();
}
finally
{
oracleConnection.Close();
}
} |
|
|---|
Public Sub CreateOracleCommand(ByVal myConnString As String)
Dim oracleConnection As New OracleConnection(myConnString)
Dim oracleCommand As OracleCommand = oracleConnection.CreateCommand()
oracleCommand.CommandText = "INSERT INTO DEPT VALUES (50,'Development','Philadelphia')"
oracleConnection.Open()
Try
oracleCommand.ExecuteNonQuery()
Finally
oracleConnection.Close()
End Try
End Sub |