StrataFrame Forum

QueryInformation Usage and Extension

http://forum.strataframe.net/Topic15052.aspx

By Ertan Deniz - 3/19/2008

I'm trying to use QueryInformation Class to store some template queries.

I wonder WhereStatement class requires fields and values (these are array) but one WhereStatementTypeOptions (Equals,Greaterthan,LessThan etc). Why ?

Please explain the general process of building Where clause from WhereStatementCollection.

And I need Dbcommand object build from the QueryInformationClass ? How can I get this ?

By Trent L. Taylor - 3/20/2008

The QueryInformation class is not really designed for use outside of our controls.  This was created for us to create queries through the BrowseDialog (and a few other places) that did not rely on a specific database language.  This is then parsed and translated at the DAL.  I do not recommend using this class as a replacement for the DbCommand....at all!  This class is not going to support many necessary features such as stored procedure calls, views, UDFs, etc.  You should use the approach that we talked about a while back on another thread about creating a base BusinessLayer class and then overriding the FillDataTable, etc. method to parse out the query and parms so that you can swap between different databases.

If you are trying to maniulate a BrowseDialog, then you would handle the Searching event and manipulate the WhereCollection.  There is a new sample of this in the 1.6.5 release in the Advanced BrowseDialog sample as well as in the help documentation: Application Framework -> UI Layer -> Controls -> Browse Dialog -> Events

By Ertan Deniz - 3/24/2008

Query Information class can be used for simple queries like implemented with BrowseDialog.

I've found the way to get Dbcommand for a QueryInformation class (For my simple queires).

SqlDataSourceItem.CreateDbCommand(query);