Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentException when accessing iDB2TimeStamp member 'PicoSecond' #82

Open
yankarinRG opened this issue Nov 10, 2024 · 3 comments
Open

Comments

@yankarinRG
Copy link

I am encountering an ArgumentException when using LinqToDB with the DB2 iSeries provider. The exception occurs when attempting to create the data connection. Below is the relevant code snippet and the exception details.

Code:

using Dapper;
using IBM.Data.DB2.iSeries;
using LinqToDB;
using LinqToDB.Data;
using LinqToDB.DataProvider.DB2iSeries;
using System;

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var connStr = "DataSource=PUB400.COM;UserId=*****;Password=*****;";
            var cnn = new iDB2Connection(connStr); // from IBM.Data.DB2.iSeries.dll
            var val = cnn.ExecuteScalar<int>("SELECT 42 AS VALUE FROM SYSIBM.SYSDUMMY1");
            // correctly returns 42

            var dc = new DataConnection(o => o.UseDB2iSeries(connStr, DB2iSeriesProviderType.AccessClient, DB2iSeriesVersion.V7_1));
            // throws
        }
    }
}

Exception Details:
System.ArgumentException: Member 'PicoSecond' does not exist in type 'IBM.Data.DB2.iSeries.iDB2TimeStamp'

Possible Cause:
Trying to access member PicoSecond (

.FromMemberAccess(iDB2TimeStampType, "Value", "PicoSecond",
) of struct iDB2TimeStamp which doesn't have that member (download NuGet package https://www.nuget.org/packages/IBM.Data.DB2.iSeries and decompile with ILSpy, you won't find that field/property)

Additional Information:
• LinqToDB version: 5.4
• DB2 iSeries version: V7R1
• .NET version: .NET Framework 4.7.2

@nsarris
Copy link
Contributor

nsarris commented Nov 19, 2024

Hi @yankarinRG

You are using aversion of the old "IBM i Access for Windows 7.1" driver that was decomissioned in 2019 and was replaced with the "IBM i Access - Client Solutions". The driver dates back to 2015. It seems someone managed to pack it in a nuget package and upload it to nuget, which is practical but none the less both unofficial and deprecated.

Unfortunately none of these drivers are available through nuget from IBM. So you have to download the package from here.

Go to Downloads for IBM i Access Client Solutions and download the package that is appropriate for your operating system (e.g. ACS Windows App Pkg English (64bit) ).

The caveat to this is that you need to delpoy the package on each server, through group policy or otherwise.

@nsarris
Copy link
Contributor

nsarris commented Nov 19, 2024

Wiki updated to include this information.

@yankarinRG
Copy link
Author

Thank you for the information. I have followed your instructions and downloaded the appropriate package for IBM i Access Client Solutions. After uninstalling "IBM i Access for Windows 7.1" and then installing "ACS Windows App Pkg English (64bit)", everything works perfectly.

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants