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!

EF Core 3.1 - Exception when trying to use TnsAdmin

TridusAug 26 2020 — edited Sep 18 2020

I'm getting the following error when trying to set a TnsAdmin path: OracleConfiguration.TnsAdmin = @"c:\oracle\client\19c\network\admin";

System.IO.FileNotFoundException

  HResult=0x80070002

  Message=Could not load file or assembly 'System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

  Source=Oracle.ManagedDataAccess

  StackTrace:

   at OracleInternal.Network.LDAP..ctor(SqlNetOraConfig SNOConfig, Hashtable ObLdapHT)

   at OracleInternal.Network.AddressResolution.SetNewLDAP(Hashtable SQLNetHT, Hashtable LdapHT)

   at Oracle.ManagedDataAccess.Client.OracleConfiguration.set_TnsAdmin(String value)

   at GNB.ELG.WellVoucher.Website.External.Startup.ConfigureServices(IServiceCollection services) in C:\workarea\Startup.cs:line 32

   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)

   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)

   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)

   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)

   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)

   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services)

   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass12_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)

   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()

   at Microsoft.Extensions.Hosting.HostBuilder.Build()

   at GNB.ELG.WellVoucher.Website.External.Program.Main(String[] args) in C:\workarea\Program.cs:line 16

This is a brand new ASP.net Core 3.1 project that isn't really doing much of anything yet. Scaffolding the dbcontext from the database works fine, however trying to run the project results in this error.

I've got the same thing in an ASP.net Core 2 project and that works without issue pointing to the same path, so I'm not sure what changed. I don't have an ldap.ora defined at all, and sqlnet.ora is as follows:

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES)

SQLNET.CRYPTO_SEED = "X"

NAMES.DEFAULT_DOMAIN = X

NAME.DEFAULT_ZONE = X

Thanks

Message was edited by: Tridus (removed beta tag as it is still an issue in production)

This post has been answered by Alex Keh-Oracle on Oct 22 2020
Jump to Answer

Comments

Gaz in Oz

Your update syntax suggests you are working with MYSQL db.

It always helps to format your code into a more readable and maintainable style, for example:

Update products,

       orderdetails,

       orders

set    products.UnitsInStock = (products.UnitsInStock - orderdetails.Quantity),

       ShippedDate = current_date()

where  products.ProductID = orderdetails.ProductID

and    orders.OrderID = orderdetails.OrderID

and   (ShippedDate is null and

       orderdetails.Quantity < UnitsInStock)

and    orders.OrderID  = 11039;

The fact the update is updating rows you don't want it to means you haven't got the join to the three tables correct.

Write it as a select statement first then convert it into an update when you are sure it will update the rows you want it to.

...and as this looks like a mysql question you be better off asking your question here or

here http://forums.mysql.com/

John Thorton

Gayathri Venugopal wrote:

Hi, I need to update UnitinStock and Shipped Date of products based on these conditions.

1)When the shipped date is null and

2) when Quantity < Unit in stock.

But my query is updating Shipped date of all the orders even when this condition Quantity < Unit in stock is not satisfied .

How do I satisfy these 2 conditions and update colums:

Update products,orderdetails,orders

set products.UnitsInStock = (products.UnitsInStock - orderdetails.Quantity), ShippedDate = current_date()

where products.ProductID =orderdetails .ProductID and orders.OrderID = orderdetails.OrderID

and (ShippedDate is null and orderdetails.Quantity < UnitsInStock) and orders.OrderID = 11039

Please click on URL below & provide details as stated in #5 - #9 inclusive

How do I ask a question on the forums?

Please post full results from SQL below

SELECT * FROM V$VERSION;

mathguy

You were told two days ago, in a different thread you started, that this is NOT A MySQL FORUM.   Repeat:  This is NOT A MySQL FORUM.  Is that hard to understand?

Timo Hahn

***Moderator action (Timo): User, I moved you thread to the MySql space as it isn't about OracleDB.***

1 - 4

Post Details

Added on Aug 26 2020
13 comments
1,224 views