Creating a new instance of any System.Data class

Feb 4, 2016 at 4:31 PM
I am trying to instantiate a new instance of System.Data classes in Jint.
According to the documentation you can allow an engine to access any .NET class by configuring the engine instance like this:
var engine = new Engine(cfg => cfg.AllowClr());
Then you have access to the System namespace as a global value.

The JINT engine can successfully create other instances such as lists, dictionaries as well as custom assemblies that have been exported to it in AllowClr.

However, accessing System.Data.DataTable for example fails with the following error:

For eg:
var myCnn = new System.Data.DataTable();

When run, this returns:

Script Error

The object can't be used as constructor.


Any help would be appreciated.