LinqToDB4iSeries / Linq2DB4iSeries

LinqToDB provider for the DB2 database on IBM iSeries
MIT License
18 stars 5 forks source link

Error connection #47

Closed franklupo closed 3 years ago

franklupo commented 3 years ago

Hi, I always get an error

System.TypeInitializationException: 'L'inizializzatore di tipo di 'LinqToDB.Data.DataConnection' ha generato un'eccezione.'

app.conf

<configSections>
    <section name="linq2db" type="LinqToDB.Configuration.LinqToDBSection, linq2db" requirePermission="false"/>
</configSections>

<linq2db>
    <dataProviders>
        <add name="iSeriesProvider" type="LinqToDB.DataProvider.DB2iSeries.DB2iSeriesFactory, LinqToDB.DataProvider.DB2iSeries" default="true"/>
    </dataProviders>
</linq2db>

<connectionStrings>
    <add name="Test" connectionString="Data Source=192.168.2.162;User ID=???;Password=??;Default Collection=????" providerName="iSeriesProvider" />
</connectionStrings>

Data Connection

    public class As400L2b : DataConnection
    {
        public As400L2b() : base("Test") { } 
      //....
    }

Open connection recive error

using (var db = new As400L2b())
{
    var aa = db.TableRAPPRG0F.Count();
}

Best regards