|
|
Browse by Tags
All Tags » In clause
-
Hello,
i have a string with a list of store numbers, something like stores=''1, 2, 3'', y like to include this on my dynamic query.
Code:1 OrderSummaryQuery q = ordenes.Query;
2 q.Select(q.StoreNo,q.OrderDate,q.OrderNumber,q.CustomerPhoneNumber,
3 q.AdjustedOrderPrice)
4 ...
-
I’m tiring to allow the user to populate the select clause from as saved list or list box. I’m hoping to be able to pass a list into the Select or Where clause as needed.
Myview coll = new myview();
List<object> myList = new List<object>
//logic to add column names ...
-
Finally figured it out, and yes these are not valid uniqueidentifiers in my example
Code:// I know the following doesn't work in SQL
user_id in (@userList)
// so I thought the following was generated
user_id in (@user_id1, @user_id2, @user_id3)
// instead, the following happens if passed in as a Guid or Object
user_id in (111-11-1111, ...
-
Martin,
I have tried passing the list in as strings vs Guids and I get the same error.
Are you suggesting I wrap the strings with quotes around my strings.
Code:List<Guid> userids = myObj.getUserIds();
List<string> users = new List<string>();
foreach(Guid userid in userids)
{
users.Add(''''' + ...
-
Using the SqlDataProvider, the generated SQL throws an error of ''Incorrect syntax near ')'''.
Code:List<Guid> userids = myObj.GetUserIds();
Query.Where(
Query.UserId.In(userids)
).Load();
// It does work with OR statements
Query.es.DefaultConjunction = esConjunction.Or;
foreach(Guid userid in userids)
{
...
-
I'm trying to implement a cached where clause with parameters that get converted to esParameters.
Code:ItemFilter filter = new ItemFilter();
filter.WhereClause = ''[issueType_id] IN (@issueList)'';
filter.AddParameter(''issueList'', ''2,3,5,6,7,8,9'');
filter.Save();
IssueCollection coll = new IssueCollection(); ...
-
try passing your List<int> in's like this instead of .ToArray()Code:
1 //textIds is a List<int> type
2 if (textIds.Count > 0)
3 {
4 StringBuilder ids = new StringBuilder();
5
6 for (int i = 0; i < textIds.Count; i++)
7 {
8 string id = Convert.ToString(textIds);
9 if ...
-
I have a generic list of ints (List<int>) and I would like to query where the ID column is equal to any int in the List.
I figured I could do this by using
Code:xCollection x = new xCollection();
List<int> ints = new List<int>();
ints.Add(1);
ints.Add(2);
ints.Add(3);
x.Query.Where.ID.In(ints)
...but ...
|
|
|