DataTable Select 相识的字符
select UesrID from userinfo where father in(left(@father,len(father))) order by layer desc在SQL Server 里面这一条语句是可以使用的。
string strfather = "'123456'";
dt.Select("father IN(LEFT(" + strfather + ",LEN(father)))", "Layer ASC");
这样写不行,我要查找 father 左边包含有 strfather
DataTable Select 怎么写才可以啊?用的是C#语言
--------------------编程问答-------------------- dt.Select("father like '"+strfather+"%'"... --------------------编程问答-------------------- 2楼的不对
不是这样的。。。
我要查找左边相似的。
如果strfather字符窜等于
123456
DataTable 里面有123这样的。
那么也能找出来。。。
你那样的只是查找右边相似的。
--------------------编程问答-------------------- 或者告诉我 IN 怎么写才可以
string strfather = " '123456 ' ";
dt.Select( "father IN("+ strfather + ") ", "Layer ASC ");
如果dt 的father 里面有 123
为什么找不出来的?
补充:.NET技术 , C#