Executing the following code fails on command.ExecuteReader() with exception:
"ERROR [] [U2] [UCINET-UO] ERROR [] [U2] [UCINET-UO] [U2][UCINET-UO] [U2][UCINET-UO] XTOOLSUB Subroutine failed. Log to Account (2). Invalid account name /data/TSSA9. Make sure /data/TSSA account is listed in ud_database file and UD.ACCOUNT. Class Name = UDAttribute Method Name = GetAttributes(...) Class Name = UDAttribute Method Name = GetAttributes(...) Source: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()
};
}
}
I'm using U2.Data.Client version 2.1.0.2051
Any thoughts or ideas would be very appreciated. Thanks.