在command.ExecuteReader()上执行以下代码失败,异常为:
“ERROR [] [U2] [UCINET-UO] ERROR [] [U2] [UCINET-UO] [U2] [UCINET-UO] [U2] [UCINET-UO] XTOOLSUB子程序失败。登录账号( 2)。无效的帐户名/数据/ TSSA9。确保/ data / TSSA帐户列在ud_database文件和UD.ACCOUNT中。类名= UDAttribute方法名= GetAttributes(...)类名= UDAttribute方法名= GetAttributes( ...)来源:U2.Data.Client TargetSite:U2.Data.Client.NativeAccess.TableInfoForNativeAccess GetTableInformation(U2.Data.Client.U2Command)“
using (var connection = ConnectionFactory.Create())
using (var command = connection.CreateCommand())
{
command.CommandText = "Select ID From CONTRACTORS;";
connection.Open();
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
var o = reader[0];
}
}
}
public class ConnectionFactory
{
public const string Password = "****";
public const string UserName = "****";
public const string Server = "****";
public static U2Connection Create()
{
var connectionStringBuilder = new U2ConnectionStringBuilder
{
UserID = UserName,
Password = Password,
Server = Server,
Database = "/data/TSSA",
ServerType = "UNIDATA",
AccessMode = "Native", // FOR UO
RpcServiceType = "udcs", // FOR UO
Connect_Timeout = 9000,
QueryTimeout = 9000,
PersistSecurityInfo = true,
Pooling = false
};
return new U2Connection
{
ConnectionString = connectionStringBuilder.ToString()
};
}
}
我正在使用U2.Data.Client版本2.1.0.2051
任何想法或想法都将非常感激。感谢。
答案 0 :(得分:1)
感谢您提出这个问题。 确保数据库'/ data / TSAA'列在两个地方。
我们将在V 2.2.0中解决此问题,以便您无需执行上述额外步骤。
此问题已在U2 Toolkit for .NET v2.2.0(BETA)中得到解决。阅读本文以获取更多信息。
Async\Await and Entity Framework 6.1 in Rocket MV U2 Toolkit for .NET v2.2.0 (BETA)
答案 1 :(得分:0)
在"输入以下命令:"提示
LOGTO sys
列出UD.ACCOUNT ALL
您可能会看到如下列表: