C# ORA-01005: 给出空密码;登录被拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14810868/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 13:04:09  来源:igfitidea点击:

ORA-01005: null password given; logon denied

c#sql-serverssasbids

提问by KalG

I have created a SSAS Database pro grammatically using SQL Server AMO namespaces. It has create successfully. But When I'm going to explore the data using BIDS of the Data source It is prompting an error like this,

我已经使用 SQL Server AMO 命名空间以编程方式创建了一个 SSAS 数据库。它已经创建成功。但是当我要使用数据源的 BIDS 探索数据时,它会提示这样的错误,

ORA-01005: null password given; logon denied

ORA-01005: 给出空密码;登录被拒绝

My Connection String is

我的连接字符串是

    @"Provider=OraOLEDB.Oracle.1;Data Source=//cmbtrndb02/hector;Password=trnint16;User ID=trnint16;Intergrated Security=yes";

I have used the ConnectionStringSecurity Property as "unchanged" but it gives the same error.

我已将 ConnectionStringSecurity 属性用作“未更改”,但它给出了相同的错误。

ds.ConnectionStringSecurity = ConnectionStringSecurity.Unchanged;

What could be the problem for this.

这可能是什么问题。

回答by user2306318

The new connection objects are losing the passwords when you use objcon.connectstring. Maybe you are reading the connectstring from the connection object (=without password) somewhere in the code instead of providing the complete connectstring including the password.

当您使用 objcon.connectstring 时,新的连接对象会丢失密码。也许您是从代码中某处的连接对象(=无密码)读取连接字符串,而不是提供包括密码在内的完整连接字符串。

回答by carl

You just need to include the password in the connectionstring as follows: if your user name is carland your password is bullet56then:

您只需要在连接字符串中包含密码,如下所示:如果您的用户名是carl,您的密码是bullet56,那么:

connectionString="Data Source=LocalHost;User ID=carl;Unicode=True;Password=bullet56"

connectionString="Data Source=LocalHost;User ID=carl;Unicode=True;密码=bullet56"

Hope it will be helpful.

希望它会有所帮助。

回答by Kamolas81

If for some reason you really need to obtain the connection string from other connection, like user2306318 refers, you need to add the option "Persist Security Info=True" to your connection string.

如果由于某种原因您确实需要从其他连接获取连接字符串,如 user2306318 所指,您需要将选项“Persist Security Info=True”添加到您的连接字符串中。

回答by Marcelo Myara

Old post but maybe this helps someone out (like it helped me):

旧帖子,但也许这对某人有所帮助(就像它帮助了我):

If you're using "System.Data.Entity.Infrastructure" on your project (maybe you are casting the DbContext to an ObjectContext for some reason?) you will be getting this error (ORA-01005).

如果您在项目中使用“System.Data.Entity.Infrastructure”(也许您出于某种原因将 DbContext 转换为 ObjectContext?),您将收到此错误 (ORA-01005)。

As I finally found out, you can easily avoid it just by adding "Persist Security Info=true" on your "Oracle.ManagedDataAccess.Client"'s string connection.

正如我最终发现的那样,您只需在“Oracle.ManagedDataAccess.Client”的字符串连接上添加“Persist Security Info=true”即可轻松避免它。

回答by Виталий Ананов

For example

例如

gacutil /u Policy.2.102.Oracle.DataAccess

gacutil /u 策略。2.102.Oracle.DataAccess

set your version assembly

设置您的版本程序集

回答by T.arif

I faced the same error in spring boot with oracle 19c, I just changed the jdk version to latest i.e 13 and it solved my problem.

我在使用 oracle 19c 的 Spring Boot 中遇到了同样的错误,我只是将 jdk 版本更改为最新的 ie 13,它解决了我的问题。