Active Query Builder support area

Prepopulate Expression Grid with partially populated rows

Avatar
  • updated
  • Completed

Ideally I need to be able to do this:

  1. Load metadata with connection string
  2. Automatically add specific table to query builder
  3. Populate Expression Grid with rows that have no expression, but with Alias (Column name) populated. This list is unrelated to the table selected.

The idea is to help the user by supplying all aliases that will be needed instead of having them type them manually.

I looked in examples such as AlternateNames, but the rows added are related to the table selected.

Is there a way to do this?

Thank you,

Simon

Avatar
Andrey Zavyalov, PM

Glad to know that the problem is solved.

Should you have any other questions, please do not hesitate to ask.

Avatar
Simon

1) OK, I got rid of the compile error, thank you. The reason it's confusing is that the namespace of MSSQLMetadataProvider is ActiveDatabaseSoftware.ActiveQueryBuilder. It's hard to figure out that a reference to ActiveDatabaseSoftware.MSSQLMetadataProvider2.dll is also needed. Anyway that works.

2) The following line was also missing from the Simple OLE DB Demo:
queryBuilder.SyntaxProvider = new MSSQLSyntaxProvider();

Once I added that I was finally able to see the combo box using the connection string!

Avatar
Andrey Zavyalov, PM

Hello, Simon.

I've just installed the full version (using the link that I gave you in my previous message), and I've found that the "ActiveDatabaseSoftware.MSSQLMetadataProvider2.dll" file is located exactly where it should be (in "c:\Program Files\ActiveDBSoft\Active Query Builder 2 ASP.NET Edition\assemblies\.NET 2.0\" folder). So it isn't removed. I think that you just have to update the references in your project.

It's not a problem that the key is not found: it's like a 30-day trial of the full version.


Avatar
Simon

I appreciate the special demo, but my issue is with the SQL connection. They way I got it to work with older versions is using:

queryBuilder.MetadataProvider = new MSSQLMetadataProvider { Connection = connection };

This does not work anymore. I get a compile error:

The type or namespace name 'MSSQLMetadataProvider' could not be found (are you missing a using directive or an assembly reference?)

Was MSSQLMetadataProvider removed?

Also I installed the Full version (thank you). But when I try to activate I get:

License with such registration key is not found.
If you feel this is wrong, please contact us to investigate this problem.

However as far as I can tell it seems to work.

Avatar
Andrey Zavyalov, PM

Hello, Simon.

Yes, the "full version" means that all possible features are present in it, including the XML feature.

You can use the "Simple Offline demo" with the full version, or the "Simple OLE DB Demo" with the free or full version, and just add the mentioned JavaScript code to it. 

Sorry, but I don't know what is your database server, what are the other connection props, so I can't provide the right connection string for you. All you need to do is to establish a connection to your database the way you know (aren't you did that before using Active Query Builder?), and then pass this connecion object to Active Query Builder:

OLE DB Connection is not the only possible DB Connection type to work with Active Query Builder. You can use SqlConnection for MS SQL Server, you can use ODBC connection for different types of servers: Active Query Builder provides special Metadata Provider objects for these types of connections: OleDbMetadataProvider - for OleDbConnection, OdbcMetadataProvider - for OdbcConnection, MsSqlMetadataProvider for SqlConnection. Different types of DB connections accept different formats of connection strings. Please establish connection to your database in a project that doesn't have Active Query Builder at all, then copy this code to the Init handler, and it will work.

Avatar
Simon

Is the XML feature present in the full license?

All I need is sample code with a working connection string, if you could please send that maybe I canfigure out why mine is not working.

Avatar
Andrey Zavyalov, PM

Hello, Simon.

Please accept my apologies for the inconveniences this problem caused you.

Indeed, the ability to load metadata from XML is missing in Free version. But the sample project that I've sent to you works fine with the free version. The problem with incorrect handling of OLE DB connection strings should be reported to Microsoft, I think.



Avatar
Simon

Still not working...

I uninstalled 2.10.14 Trial and installed 2.10.14 Free.

I am trying to work with the "Client event handle" sample, but without adding any of the new code it doesn't run.

I want to load the XML just like the Trial version does. So I copied:

queryBuilder.MetadataContainer.ImportFromXML(Page.Server.MapPath(ConfigurationManager.AppSettings["XmlMetaData"]));

But this causes a compile error:

'QueryBuilder' does not contain a definition for 'MetadataContainer' and no extension method 'MetadataContainer' accepting a first argument of type 'QueryBuilder' could be found

So I tried to load a connection instead using:

System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection{
	ConnectionString = ConfigurationManager.ConnectionStrings["Northwind"].ConnectionString
};

But then I get

An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.

I tried adding my Provider to the connection string (which should not be needed anyway) and it still doesn't work.

Can you please send me code that works? I have installed 5 different releases and spend a month on this very simple project.

Thank you

Avatar
Denis Shundeev

Hello, Simon.

Indeed, we've found that this code doesn't work in the current version, even it's technically possible make it work. Please accept my apologies for this mistake.

 

Avatar
Andrey Zavyalov, PM

Thank you for detailed report.

We will investigate the problem and let you know about result tomorrow.