This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello All, I'm building a VB.Net application that uses Lightspeed 4.0. The User has a need for a form that shows various properties of an entity. The User wants to be able to query the table based on any field or fields that they choose to use in the form. Because I don't know which fields the User will pick, I figured that I would have to build the query programmatically. Therefore, I also figured I have two options here. One is setting up a Query object and using the BuildSQL method to create the selection statement by code, and the second option is to use the FindbySQL method of a unitofwork. I have a few questions... One, is there any other/better options available? Two, of the two I listed, which is better, or is there a preferred way? And three, does anyone have ANY examples, preferably in VB.Net of any and/or all of the methods listed or suggested. I think I have a handle on the unitofwork.FindBySQL method, as it uses a dbCommand as a parameter, so I figure that I create a command and supply it's SQL string. So that one, I think is relatively easy, but, I would still like to see examples of anything else, especially the query.buildSQL method... Thanks in advance, Kevin Orcutt |
|
|
Yes you can build up the QueryExpression on a Query programatically and you can use Entity.Attribute(string) to avoid complication around translating a user selected field name into the field to be queried on entity. I believe this approach should cover what you are after, but do you see any issues with this?
|
|