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
|
Hi, I try to write a search-panel. I have a panel with some comboboxes and textfields. after clicking the search-button, it should start something like this:
string[,] searchlist = new string[100,100]; if (cbbWorkflowState.SelectedItem != null) { searchlist.SetValue(new string[2] { cbbWorkflowState.SelectedItem.ToString(), "Status" }, index); index++; } if (txtOrderRef.Text != "") { searchlist.SetValue(new string[2] { txtOrderRef.Text, "Reference" }, index); index++; }
in this array is in first dimension the search string, the second is the entity property
try {
this doesn't work, exception is that the where-method has invalid arguments. |
|
|
sorry for double-post, i got an error message and thougt, it wasn't send |
|
|
A LINQ query requires an expression. Such expressions are generated by the C# compiler when you compile LINQ code. You cannot pass a string of C# source code at runtime because the compiler is out of the loop by then -- LINQ engines do not contain their own built-in compilers and will not parse source code for you. For composing queries at runtime based on strings, you can either use query objects and the Entity.Attribute(attrName) syntax (see http://www.mindscapehq.com/documentation/lightspeed/Basic-Operations/Querying-the-Database-Using-Query-Objects) or use one of the various 'dynamic LINQ' toolkits (e.g. http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx). |
|
|
By the way, the forums error message occurs because you have entered an invalid email address -- unfortunately our forums engine does not handle this at all well! |
|