UniDirect .NET Frequently Asked Questions
Answers
What is the difference between Standard and Professional version?The main difference is that the Professional Edition includes some additional tools that save you time and effort. The following list briefly enumerates the main advantages of the Professional Edition.
- Bundled Devart data providers for accessing Oracle, MySQL, and PostgreSQL servers without additional software.
- Support for DBMonitor to perform per-component tracing of database events such as SQL statement execution, commit, rollback, etc.
- DataSet Wizard for greatly simplifying the process of generating datasets in your application.
- Enterprise Library support for taking advantage of Data Access Application Block functionality.
- ASP.NET 2.0 Provider Model support for using UniDirect .NET as one of the ASP.NET 2.0 providers.
Make sure you had uninstalled the trial version correctly. There should be no old (trial) assemblies present in your system. Uninstall UniDirect .NET and check your Global Assembly Cache and local folders for CoreLab.* assemblies. Remove all CoreLab.* files and reinstall UniDirect .NET. To upgrade to newer version I have to uninstall UniDirect .NET first. How do I do it right?
Close all running IDEs and help collections, then choose Uninstall UniDirect .NET link from Start menu. You say, there are sample projects, but I can't find any.
Probably you installed UniDirect .NET not in typical mode. Please choose typical when installing UniDirect .NET. All samples are installed by default in \Program Files\UniDirect.NET\Samples folder. Are there any restrictions for Visual Studio Express editions?
Yes, there are some. First, the provider add-in (and hence menu item) is not available. Second, components are not registered in toolbox automatically (though you can do it manually). Finally, advanced Visual Studio integration (DDEX) is not available, except Microsoft Web Developer 2005 Express. What is required for my application to work on end-user machine?
To deploy applications written with UniDirect .NET, copy the run-time assemblies CoreLab.UniDirect.dll and CoreLab.UniDirect.xxx.dll (xxx is codename of data provider you work with) to target machine. These assemblies can be registered at the Global Assembly Cache (GAC) for the appropriate .NET Framework or placed in the folder of your application.
If you are using the standalone (not bundled) data providers, you will also have to deploy their assemblies. Please refer to corresponding topics in the documentation.
Another way to install the *.dll files of UniDirect .NET is to launch setup program of UniDirect .NET and choose "Minimal" option. Note that according to License Agreement this is the only setup mode that you can use on target machine. How to install UniDirect .NET on machine that does not have Visual Studio .NET or Delphi installed?
Choose "Minimal" type when asked by the installer. How to deploy web projects that use UniDirect .NET?
In addition to common deployment routine, you may also need to deploy the CoreLab.UniDirect.Web.dll, CoreLab.xxx.Web.dll and App_Licenses.dll assemblies. The *.Web.dll assemblies are required for using the ASP.NET Provider Model, and the App_Licenses.dll assembly is a part of Licensing mechanism. Also keep in mind that web projects are usually run as partially trusted code. UniDirect .NET requires ReflectionPermission in addition to the medium trust level; the actual data provider may require other permissions. for more information refer to corresponding documentation. Licensing What is the licensing you use?
UniDirect .NET uses .NET component licensing. To build operational application UniDirect .NET requires valid license. If no license is available, UniDirect .NET does not work.
Note that if you use other Devart data providers, they require valid license as well, unless you use the bundled providers with the Professional Edition of UniDirect .NET. How to embed license into my application?
Usually you do not have to care about embedding license in your application. When you install UniDirect .NET the system is configured so that licensing is done transparently. License is automatically added to project when you place a UniConnection component onto a form.
You may be required to add license manually. It is necessary for console applications, class libraries, some ASP.NET applications and existing projects initially built with UniDirect .NET version 1.00. For instructions on how to add the license manually refer to Licensing topic in UniDirect .NET help. On opening connection I get an exception saying "License not found...". What should I do?
This generally indicates that license information could not be found, or you try to apply it in some way that does not suit the kind of application. For example:
- File licenses.licx, required for UniDirect .NET to function properly, could not be found.
- File licenses.licx is not added as embedded resource.
- File App_Licenses.dll not found in ASP.NET applications.
To fix the problem determine type of your application and read corresponding section of "Licensing" topic.
On opening connection I get an exception saying "License not valid...". What should I do?This means that license information was found but it is incorrect. It usually happens in the following cases:
- The project was earlier compiled with old or trial version of data provider.
- File licenses.config used by a class library does not refer to launched executable.
- The App_Licenses.dll belongs to other application or needs to be recompiled.
- Something's wrong with the operating system or installation of UniDirect .NET.
If you encounter this problem delete all files from obj folder and rebuild the project. If this does not help send to our support address small compiled binary with sources so we can investigate the problem detailed.
Deployed application worked fine some time, but in some moment it started to say "Sorry, your trial period has expired". But I do not use trial version any more.Probably you compiled the application with Trial edition of UniDirect .NET, and deployed it with assemblies from non-trial version. In this case time limit is actual as well. To eliminate the problem just recompile the project. How to license ASP.NET applications?
To support server-side compilation you ought to have special assembly App_Licenses.dll in the Bin directory of your site. To create this assembly execute Build Runtime Licenses command in the licenses.licx file context menu in the Solution Explorer view. Required assembly will be created automatically.
Note that this is not necessary for precompiled ASP.NET applications (if nothing is compiled on server by user request). Precompiled applications are licensed as usual applications.
Do end-users need a license?No, end-users of your application do not require any license. Connection pooling I call UniConnection.Open(), then Close(). Physical connection is still visible by server. Isn't it a bug?
No, it is not. This is Connection Pooling feature. Actual connection is not closed in order to be used later by your application. This boosts performance greatly. I get exception "Timeout expired. The timeout period elapsed..." What to do?
The full text of the exception is "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached." It clearly states that you have run out of connections available. To solve the problem increase Max Pool Size connection string parameter value. The default value is 100. Another way to get extra connections is to clear one or all of the pools. Or you can turn connection pooling off using Pooling connection string parameter. How to prevent possible pooling problems?
You can clear the pool explicitly. Generally the pool is cleared automatically when connections are idle or closed by server. To force the operation, call ClearPool or ClearAllPools methods. Another solution is to disable the pool at all (set Pooling=false in connection string). If this does not help, the problem is not caused by pooling. Documentation problems How to open documentation on UniDirect .NET?
There are several ways to open UniDirect .NET documentation:
- Use appropriate shortcut in start menu, for instance, Start - Programs - Devart UniDirect .NET - UniDirect .NET documentation.
- Use command in the IDE: Tools - UniDirect - UniDirect .NET Help.
- Position cursor on some class from CoreLab.UniDirect and press F1.
Correctly installed documentation appears as separate node in combined collection of Visual Studio and Borland Delphi. If you can't find UniDirect .NET node there it is because you enabled topics filtering. To reveal the node set filter to "Devart Documentation", or "(unfiltered)", or "Visual C#", etc.
Another possible reason is that you installed some IDE after installation of UniDirect .NET. In this case use aforementioned methods to reach documentation. All topics in CHM file are blank.
This can happen due to some patches from Microsoft installed on your system. Please read this page to find possible solutions for the problem. In most cases it is enough to right-click on the CHM file, select Properties, click on the "Unblock" button and click "Apply" to show the contents. Miscellaneous Are there any compatibility limitations in the Mobile Edition of UniDirect .NET?
Yes, the Mobile Edition of UniDirect .NET can work only with the following servers: Oracle, SQL Server, MySQL, PostgreSQL. I get concurrency error when modifying records using UniDataAdapter. What can be wrong?
This can happen when UniCommandBuilder generates a query without primary key field. To avoid it use custom update command instead of generated by UniCommandBuilder. This problem should not take place if primary key field participates in SELECT statement. No components can be found in the toolbox.
This can happen if the installation encountered some problems. You can add the components to toolbox manually. This procedure is described in the Installation article in the documentation. Note that Microsoft Web Developer 2005 Express edition does not allow to work with toolbox at all. UniDirect .NET components in Visual Studio .NET 2005 are grey...
Make sure you're in Component Designer view. Do not confuse with Designer view. To switch between views use context menu of .aspx file in Solution Explorer. This relates to Web projects only. How to compose a connection string for UniDirect .NET?
Generally the connection string is same as for the native data provider, with addition of Provider=ProvName; fragment. You can also use pooling options with any underlying data provider. How can I determine what should I state as the provider name in the connection string?
See the Supported Providers topic in the UniDirect .NET documentation, or use the ProviderManager.GetProviderNames method. How can I switch to non-bundled dotConnect for MySQL (dotConnect for Oracle, dotConnect for PostgreSQL) in the Professional Edition?
Register the CoreLab.UniDirect.MySql.dll (CoreLab.UniDirect.Oracle.dll, CoreLab.UniDirect.PostgreSql.dll) in the Global Assembly Cache with gacutil. For more information on the matter see the Using Bundled Data Providers topic in the documentation. Can I use a data provider that is not mentioned in your list of supported providers?
Sure, there are several ways to do this. See topic UniDirect .NET and Arbitrary Data Providers in the documentation. How can I write SQL statements without being database-dependent?
UniDirect .NET introduces a brand new feature, which allows to compose SQL statements that are adjusted in run time before executing on the server. This is Unified SQL, or UniSQL. It allows developer to use conditional expressions and blocks of code, write literals and invoke functions in unified syntax, and many more features. See article UniSQL in the documentation for introduction to Unified SQL. The UniParameter class has two similar properties: DbType and UniDbType. Which property should I use?
Use the UniDbType property because it is mapped to database types more precisely. When you set either of the properties, another one is adjusted automatically. What servers can I use with the ASP.NET 2.0 provider model?
In UniDirect .NET you can use the ASP.NET 2.0 provider model with data providers for Oracle, MySQL, PostgreSQL, and SQL Server. I use UniDirect Mobile and get "InvalidProgramException", "AsmNotLoaded" errors when running my app on Pocket PC...
Such exceptions are usually caused by the fact that UniDirect provider assembly (such as CoreLab.UniDirect.MySql) or target provider assembly (such as CoreLab.MySql) is missing or invalid at your Pocket PC. You have to deploy them manually to the target application's directory. Make sure that the following conditions are true:
- You have UniDirect provider assembly (such as CoreLab.UniDirect.MySql.dll) on your device in the application's directory.
- You have a target provider assembly (such as CoreLab.MySql.dll) on your device in the application's directory.
-
You have application config file (DeviceApplication.exe.config) with <bindingRedirect> element for your target provider assembly (e.g. CoreLab.MySql). This is needed when version of target provider assembly differs from version that UniDirect was designed for.
Here is an example of the application config file (DeviceApplication.exe.config) in the case when target provider is dotConnect for MySQL and the application name is DeviceApplication.exe:
<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="CoreLab.MySql" publicKeyToken="09af7300eec23701" culture="neutral" /> <bindingRedirect oldVersion="4.25.22.1" newVersion="4.25.25.1"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration>In this file oldVersion represents the assembly that UniDirect .NET was designed for, and newVersion is the version of CoreLab.MySql.dll you actually use.
The example configuration files are located in the folder where you installed UniDirect .NET. You have to copy the file to your project, rename it to match the application name, and adjust the newVersion attribute of the bindingRedirect tag to match your version of the provider assembly.
