嗨每个人(像模拟) [英] hi every body(like simulation)
本文介绍了嗨每个人(像模拟)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在C#10中的datatable.select中使用like吗?
例如:datatable1.select(name like''A__Z'')用于4长度的记录并以A开头并以Z结尾?
谢谢。
can i use "like" in datatable.select metheod in C#10?
e.g : datatable1.select("name like ''A__Z''") for records that have 4 lenght size and start with "A" and ends with "Z" ?
thanks.
推荐答案
如果您考虑使用.Net framework 1.0或1.1在C#10中,您应该升级到.Net framework 2或更高版本并使用 Linq to SQL 。
请查找.Net Framework 1.1,2.0,3.5之间的区别
从C#2.0到4.0
的例子:
if you considered .Net framework 1.0 or 1.1 instead of "C#10", you should upgrade to .Net framework 2 or later and use Linq to SQL.
Please find difference between .Net Framework 1.1 , 2.0 , 3.5
From C# 2.0 to 4.0
example of :
from u in datatable1
where
u.name.Length == 4 &&
u.name.StartsWith("A") &&
u.name.EndsWith("Z")
select u
尝试
Try
datatable1.Select("Name LIKE 'A%' AND Name LIKE '%Z' AND LEN(Name) = 4");
这将采用LINQ或RegEx。
That is going to take either LINQ or RegEx.
这篇关于嗨每个人(像模拟)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文