What's the 'new' way of establishing a OraConnection? Microsoft defines several classes as obsolete.
https://msdn.microsoft.com/en-us/library/system.data.oracleclient.aspx
I used to make use of something along those lines:
string queryString =
"INSERT INTO Dept (DeptNo, Dname, Loc) values (50, 'TECHNOLOGY', 'DENVER')";
using (OracleConnection connection = new OracleConnection(connectionString))
{
OracleCommand command = new OracleCommand(queryString);
command.Connection = connection;
try
{
connection.Open();
command.ExecuteNonQuery();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
However all those Classes seem to be deprecated.
OracleClient as per the standard support policy for . Net Framework 4.0.
An OracleConnection object represents a unique connection to an Oracle database. In the case of a client/server database system, it is equivalent to a network connection to the server.
Data. OracleClient is a Microsoft . NET data provider allowing you to connect to an Oracle database. The provider is deprecated and it should not be used - Oracle and ADO.NET.
ExecuteNonQuery Method (System. Data. OracleClient) Executes an SQL statement against the Connection and returns the number of rows affected.
Yes the System.Data.OracleClient is Obsolete.
Download the latest Oracle Client (ODP.Net) as per link below:
http://www.oracle.com/technetwork/topics/dotnet/index-085163.html
and reference the following namespace in your code
using Oracle.DataAccess.Client;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With