Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to configure DbContext with ODP.NET Core

c0036513-d01d-46af-8a69-d47e16c6c3ceOct 25 2018 — edited Apr 3 2019

It seems that Oracle released the ODP.NET Core version (see https://www.nuget.org/packages/Oracle.ManagedDataAccess.Core/). If this is accurate, please share how to set it up by using the DbContextOptions (or in any other "injectable" way, not by manually instantiating the connection and command objects (as in https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/ODPNET_Core_get_started/index.html).

I am not able to configure the DbContext from the Startup, Configuration method as described in StackOverflow (https://stackoverflow.com/questions/52972234/options-useoracle-not-available-in-ef-core ):

services.AddDbContext<BloggingContext>(options => options.UseOracle(ora_conn)); 

"UseOracle" is not a method that is available.

I have included the following namespaces:

using Oracle.ManagedDataAccess.Client;

using Microsoft.EntityFrameworkCore;

Even when I try dotnet ef dbcontext scaffold (with and without the option -c HiddenContext), it fails with the error "Unable to find expected assembly attribute named DesignTimeProviderServicesAttribute in provider assembly Oracle.ManagedDataAccess. This attribute is required to identify the class which acts as the design-time service provider factory."

dotnet ef dbcontext scaffold "DATA SOURCE=hidden;PASSWORD=hidden;PERSIST SECURITY INFO=True;USER ID=hidden;Connection Timeout=60;min pool size=0;connection lifetime=1800;" Oracle.ManagedDataAccess --output-dir Tables --schema hidden -t table1 -t table2 -t table3 -t table4 -t table 5 -v

What am I missing? Can anybody point me to any suggestions out there?

Please, please, help...

This post has been answered by Mark Williams on Oct 25 2018
Jump to Answer

Comments

TSharma-0racle

I didn't understand the question clearly but will this work for yo?

SET MARKUP HTML ON

spool on

query

spool off

This will generate a html report from sqlplus

user10936714

This is helpful, but the main problem is to get the HTML into the clipboard with MIME type "text/html" so that when you paste it the email client knows that it is HTML instead of just text. My experience with sqlplus is that it is just a command-line/console app.

TSharma-0racle

Check this if this can help:

Converting Query results into HTML email

SchemaCzar

+1 to this as a feature request

  1. copy as html to clipboard
  2. FEWER CLICKS when exporting from query result!
  3. some controls over html template/styles
  4. Create html email from query result
SchemaCzar

I've had good luck with the html markup, but sqlplus is so last millenium....

Marwim

... but sqlplus is so last millenium....

Seriously? I'm from the last millennium too, nevertheless I don't consider myself out of date

SQL*PLUS is still my first choice when I have to run a script. I'ts behaviour is reliably the same whereever my script is executed. I would never trust a script that needs another tool to be executed.

Generating a HTML-mail is IMHO out of scope for a database tool. It's a feature I would expect in a BI tool that specializes on reporting.

Regards

Marcus

1 - 6

Post Details

Added on Oct 25 2018
29 comments
34,583 views