我的任务是在我们的搜索中增加一个选择,在某个领域(
但是,我对如何取得不属于A-Z组的产物感到沮丧,同样希望它产生一些中等效率的基调。
任何帮助——感谢。
我的任务是在我们的搜索中增加一个选择,在某个领域(
但是,我对如何取得不属于A-Z组的产物感到沮丧,同样希望它产生一些中等效率的基调。
任何帮助——感谢。
在C#中,将db作为数据背景使用以下建筑:
var query = from row in db.SomeTable
where !System.Data.Linq.SqlClient.SqlMethods.Like(row.SomeField, "[A-Z]%")
select row;
This is only supported in LINQ to SQL queries. All rules of the T-SQL LIKE operator apply.
你们也可以使用更有效的解决办法:
var query = from row in db.SomeTable
where row.SomeField[0] < A || row.SomeField[0] > Z
select row;
This gets translated into SUBSTRING, CAST, and UNICODE constructs.
最后,你可以使用VB,在这种地方,似乎当地人支持类似方法。
虽然在使用彩票(<条码>[a-f]%(例如)的电离层电离层电离层电离层电离层电离层电离层电离层信号中能够检查一系列特性,但我只看到了一条支线,可以直接支持这种特性。
两点思想:
首先,如果所设定的结果相对较小,你可以填写<代码>。
或者,如果你有能力改变数据模型,你可以设立更多的领域或表格,帮助对数据进行索引,改进搜索。
页: 1
下面根据Ruslan的评论做了改动。
我完全不赞成这样做,因为我从未尝试过,没有附近的编辑来尝试,但我所尝试的第一项事情是。
var query = from x in db.SomeTable
where x.SomeField != null &&
x.SomeField.Length >= 1 &&
x.SomeField.Substring(0, 1).All(c => !Char.IsLetter(c))
select x;
现有的准则是,LLQ未能将其转换为Q。
Using linq? and XML is there a way to convert this IEnumerable to a string array of the value parameter? List<string> idList = new List<string>(); foreach (XElement idElement in word....
I have two tables, Tags(tagid, postid, tagname) and posts(postid, name, ...) now i want to make a query that returns me all posts that have a generic amount of tags. like: i want all posts that have ...
I m working with a set of legacy DAO code that returns an IList, where each Hashtable represents the row of a dynamically executed SQL query. For example, the List might contain the following records/...
I have a List<> of custom objects. This custom type has a property called Name which should be unique among the list. In other words, no 2 items items in the list should have the same value for ...
Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...
When using GTK# from C# on Mono, I often find myself copying out C# data structures into Gtk.ListStore -- it would be much easier if there was a Gtk.TreeModel which wrapped an IEnumerable. Does such ...
i have list of items IList with data that looks list this: GenId TestMode 1 0 1 1 3 0 3 1 4 NULL 2 NULL i want to remove the index ...
Im looking to group and sort a Generic List<>. I have a list of objects representing files and each of these objects has a FileName, FileType and FileDate property. FileType is defined as an ...