Dependencies--right--manage NuGet Packages--Browse--Enter the following
Oracle. Manageddataaccess.core(remember to check include pre-release version)
How to add an operational database to a page
Public Iactionresult Get () {try {string connstr = "DATA SOURCE = Service Address of the service device; PASSWORD = password; PERSIST SECURITY INFO = True; User ID = username "; OracleConnection conn = new OracleConnection (CONNSTR); IF (Conn. state = = connectionstate.closed) {Conn. Open (); } oraclecommand command = conn. CreateCommand (); Command. Connection = conn; DataTable datatable = new DataTable (); Command.commandtext =string. Format (@ "SELECT * from Web_nature_repair"); OracleDataAdapter oradata = new OracleDataAdapter (); Oradata. SelectCommand = command; Oradata. Fill (dataTable); Command. Parameters.clear (); Conn. Close (); int count = DataTable.Rows.Count; Return Ok (count); } catch (Exception ex) { Logger.error ("error log-----------"); Logger.error (ex. Message); Return NotFound (ex. Message); } }
Run the project
. NET Core Operations Oracle