Unable to use license key in Framework applications
Posted: Mon 17 Aug 2020 19:28
We’ve just purchased a license for LinqConnect, after successfully trialling the product (with SQL Server). However, after removing the trial version, and installing the new version, we’re unable to get the license key to apply.
The project we’re testing this with initially used System.Data-style DBML files in a Framework library; we converted these to lqml files and the library to .Net standard and these work fine with the trial version. After removing and reinstalling the full version, we’ve changed the connection string in the code to use the license key.
Using the context in a .Net core application appears to work fine. However, using the context from a Framework application throws an error. Here’s an example of the context being initialised:
However, this gives the exception
Running the same context from a .Net core application appears fine.
I can see from the above exception that System.Data is being used; I've no idea if this is "normal" or not, but it's not something I'm doing deliberately (and doesn't appear to cause an issue with Core). Can anyone help?
The project we’re testing this with initially used System.Data-style DBML files in a Framework library; we converted these to lqml files and the library to .Net standard and these work fine with the trial version. After removing and reinstalling the full version, we’ve changed the connection string in the code to use the license key.
Using the context in a .Net core application appears to work fine. However, using the context from a Framework application throws an error. Here’s an example of the context being initialised:
Code: Select all
var xdc = new classLibrary.ExampleContext(@"Data Source=sqlserver;Initial Catalog=myDatabase;User ID=user1;Password=xxx;License Key=nIzQMwNngKlwn9FTcy….;");
However, this gives the exception
Code: Select all
System.ArgumentException
HResult=0x80070057
Message=Keyword not supported: 'license key'.
Source=System.Data
StackTrace:
at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at Devart.Data.Linq.DataProvider.Initialize(Object connection)
at Devart.Data.SqlServer.Linq.Provider.SqlDataProvider.Initialize(Object connection)
at Devart.Data.Linq.DataProvider.a(IDataServices A_0, Object A_1)
at Devart.Data.Linq.DataContext.a(Object A_0, MappingSource A_1, Type A_2, String A_3, Boolean A_4)
at Devart.Data.Linq.DataContext..ctor(String connectionString, MappingSource mapping)
I can see from the above exception that System.Data is being used; I've no idea if this is "normal" or not, but it's not something I'm doing deliberately (and doesn't appear to cause an issue with Core). Can anyone help?