0

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.

Gary Brunton
  • 1,840
  • 1
  • 22
  • 33
  • Have you confirmed that account /data/TSSA is indeed in the ud_database file and UD.ACCOUNT? – Tap Sep 15 '14 at 23:55
  • Well that's a great question. Unfortunately I'm not sure what that means or how to check or what to do if it isn't. I was under the impression that connecting this way meant I didn't need to update server configs but apparently I'm wrong? – Gary Brunton Sep 15 '14 at 23:57

2 Answers2

1

Thank you for asking this question. Make sure database ‘/data/TSAA’ is listed in two places.

  1. ud_database (see screen shot) (in windows, C:\U2\ud73\INCLUDE\ud_database)
  2. UD.ACCOUNT (see screen shot) a. Logto ‘sys’ account b. LIST UD.ACCOUNT c. Make sure you have ‘/data/TSAA’ entry there.

We will fix this issue in V 2.2.0 so that you do not need to do the above said extra steps.

This issue is resolved in U2 Toolkit for .NET v2.2.0 (BETA). Read this for more information.

Async\Await and Entity Framework 6.1 in Rocket MV U2 Toolkit for .NET v2.2.0 (BETA)

enter image description here

enter image description here

Rajan Kumar
  • 718
  • 1
  • 4
  • 9
  • Are these files on the server or the client? Our db server is a unix box. – Gary Brunton Sep 16 '14 at 16:49
  • When I log into udt and execute the LIST UD.ACCOUNT command I get "Not a filename". Sorry but my unidata knowledge is rather sparse. – Gary Brunton Sep 16 '14 at 17:03
  • you need to do, LOGTO sys. See another answer for details. – Rajan Kumar Sep 16 '14 at 20:51
  • I don't seem to have permission since I receive a errno=13: Permission denied – Gary Brunton Sep 16 '14 at 21:39
  • Could you please send us email u2askus@rocketsoftware.com (Attn: Rajan Kumar)? We will try to provide you a tool that updates your UD. ACCOUNT’ file. In the meantime , you can try ‘demo’ account. So you need to replace ‘‘/data/TSAA’ with ‘demo’. I hope ‘demo’ account is listed both in ‘ud_database’ and ‘UD.ACCOUNT’. – Rajan Kumar Sep 16 '14 at 23:45
  • I've requested that I'd be given access so hopefully soon I'll get it. I'll send you an email shortly. Thanks for your help. – Gary Brunton Sep 17 '14 at 03:29
0

Type in the following commands at the ":" prompt

LOGTO sys
LIST UD.ACCOUNT ALL

You may see a list like this:

enter image description here

jbmonco
  • 130
  • 4