Page 1 of 1

QueryBuilder throws security exception

Posted: Fri Apr 05, 2013 7:37 am
by robocik
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:
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.
MainWindow Xaml code:

Code: Select all

<WindowsFormsHost Grid.Row="1" x:Name="BrowserHost">
      <Database:QueryBuilder x:Name="queryBuilder" />
</WindowsFormsHost>
I use the following code to fill querybuilder control:

Code: Select all

StiSqlMetadataProvider provider = new StiSqlMetadataProvider(new SqlConnection(connectionString));
queryBuilder.MetadataProvider = provider;
queryBuilder.SyntaxProvider = new MSSQLSyntaxProvider();
queryBuilder.SQL = string.Empty;
queryBuilder.RefreshMetadata();
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?

Re: QueryBuilder throws security exception

Posted: Fri Apr 05, 2013 12:15 pm
by HighAley
Hello.

We couldn't reproduce the issue.
Could you send us a sample project which reproduces the issue?

Thank you.

Re: QueryBuilder throws security exception

Posted: Fri Apr 05, 2013 12:28 pm
by robocik
Thanks for quick feedback. I've realized that I downloaded old version of your product (see the version number from my initial post: 2012.3.1500.0). I don't know how I downloaded it (where did I find this old version because yesterday basically I wanted to try out your latest version). But anyway, when I downloaded the latest version then problem is gone and everything is working good.
Thanks

Re: QueryBuilder throws security exception

Posted: Fri Apr 05, 2013 12:42 pm
by HighAley
Hello.

Maybe the issue was fixed.
Please, let us know if you will have any problems else.

Thank you.