general error: database ‘T’ not connected

huangapple go评论66阅读模式
英文:

general error: database 'T' not connected

问题

我正在尝试在MVC中连接SAP HANA数据库,但我遇到了这个错误。

常规错误:数据库 'T' 未连接

这是连接的代码:

using (HanaConnection sqlConnection = new HanaConnection("Server='192.168.0.13:30015'; UserName='S'; Password='E'; DATABASENAME='T'"))
{
    sqlConnection.Open();
}

可能的原因是什么?我还尝试将端口更改为

30013

但收到了以下错误:

连接失败 (RTE:[89006] 系统调用 'connect' 失败,rc=10061: 无法与目标计算机建立连接。

我可以使用PHP使用这个连接字符串进行连接。

英文:

I am trying to connect SAP HANA database in MVC, but I'm getting this error.

general error: database 'T' not connected 

This is the code for connection:

using (HanaConnection sqlConnection = new HanaConnection("Server='192.168.0.13:30015'; UserName='S'; Password='E'; DATABASENAME='T'"))
            {
                sqlConnection.Open();
            }

What could be the cause of this? I also tried changing my port to

30013

but got this error:

Connection failed (RTE:[89006] System call 'connect' failed, rc=10061:No connection could be made because the target machine actively refused it.

I can connect with this connection string using PHP.

答案1

得分: 0

看起来没有名为'T'的租户数据库可用。如果您尚未配置此租户,请尝试省略databaseName属性,只需使用以下方式连接:

new HanaConnection("Server='192.168.0.13:30015'; UserName='S'; Password='E'")

根据错误消息,似乎端口30015是正确的,因为第一个错误是来自数据库本身,而第二个错误则不是。

英文:

It seems like there is no tenant database named 'T' available. If you have not configured this tenant, please try to omit the databaseName property and simply connect using

new HanaConnection("Server='192.168.0.13:30015'; UserName='S'; Password='E'")

Based on the error messages it seems that port 30015 is correct as the first error is originating from the database itself and the second is not.

huangapple
  • 本文由 发表于 2023年2月10日 16:15:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/75408449.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定