Getting Started with the ADO.NET provider
The easiest way to install the ADO.NET provider is to install the K2 Core components on the machine that will be executing the code, but note that you may need to perform additional configuration to register the provider in the design tool being used. You may need to refer to that design tool's documentation for further information on registering third-party providers.
The SourceCode.Data.SmartObjectsClient.dll assembly is installed in the GAC of the K2 server and on developer workstations when the K2 Core component is installed. You can also find the assembly at the following location:
"%PROGRAMFILES%\K2\Bin\SourceCode.Data.SmartObjectsClient.dll"
When using the ADO.NET provider in a Visual Studio project, add a reference to the following assemblies:
- SourceCode.Data.SmartObjectsClient.dll
- SourceCode.HostClientAPI.dll (this reference is optional, used to construct more advanced connection strings if needed)
Using the SmartObject Service Tester utility to write and test ADO Queries
The simplest way to write and test an ADO query is to use the ADO Query option in the SmartObject Service Tester utility. The smartobject tester tool can be found in the installation directory. "%PROGRAMFILES%\K2\Bin\SmartObject Service Tester.exe"
-
Navigate to the location of the utility and launch it.
-
Locate the SmartObject or SmartObject method that you wish to test, and then right-click the ADO Query option
. Alternatively, you can click the ADO Query button in the toolbar to open the ADO Query window.
- Write the ADO query in the ADO Query textbox and click the Execute button to run the query
- Once you are satisfied with the query, select the query text and use the Edit > Copy menu to copy and paste the query into your ADO-compatible design tool or code.
Limitations
IN Clause
If non-direct execution is used that has more than 99 values in the IN clause an error will occur stating "An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll." When non-direct execution is used, every value in the IN clause is added as an OR filter.
Data Source Configuration Wizards
The K2 ADO.NET Provider does not support the Visual Studio Data Source Configuration Wizards. The ADO.NET Provider supports SqlDataSource objects in ASP.NET Applications and the Business Intelligence Project type.