QueryBuilder throws security exception
Posted: Fri Apr 05, 2013 7:37 am
I've created a very simple project in WPF. I use QueryBuilder control in the main window. But when I try to set SQL property of QueryBuilder I get this exception:
I use the following code to fill querybuilder control:
Exception is thrown in this line: queryBuilder.SQL = string.Empty;
I used .NET 4 project but on my machine I also have Visual Studio 2012 installed (so probably I ran this app using .NET 4.5). Stimulsoft is version: 2012.3.1500.0
How can I solve this problem?
MainWindow Xaml code:Attempt by security transparent method 'Stimulsoft.Database.QueryBuilder.SetSQL(System.String)' to call native code through method 'Stimulsoft.Database.Win32.PostMessage(IntPtr, Int32, IntPtr, IntPtr)' failed. Methods must be security critical or security safe-critical to call native code.
Code: Select all
<WindowsFormsHost Grid.Row="1" x:Name="BrowserHost">
<Database:QueryBuilder x:Name="queryBuilder" />
</WindowsFormsHost>
Code: Select all
StiSqlMetadataProvider provider = new StiSqlMetadataProvider(new SqlConnection(connectionString));
queryBuilder.MetadataProvider = provider;
queryBuilder.SyntaxProvider = new MSSQLSyntaxProvider();
queryBuilder.SQL = string.Empty;
queryBuilder.RefreshMetadata();
I used .NET 4 project but on my machine I also have Visual Studio 2012 installed (so probably I ran this app using .NET 4.5). Stimulsoft is version: 2012.3.1500.0
How can I solve this problem?