- access关键字
- 选择关键词需要考虑的几个因素
- pr值是什么?影响网页PR值的几个因素
- AJAX应用之注册用户即时检测
- 今日结论
- 如何把握关键词的竞争力度
- SQL2000和SQL2005和SQL2008同时安装问题
- Indexof 的用法
- 提高关键词排名和网站收录
- 京东标题怎么做?
邮箱:
手机:15383239821
DataTable.Select 方法 (String, String)
http://msdn.microsoft.com/zh-cn/library/way3dy9w%28VS.80%29.aspx
public DataRow[] Select (
string filterExpression,
string sort
)
参数
filterExpression
要用来筛选行的条件。
sort
一个字符串,它指定列和排序方向。
返回值
与筛选表达式相匹配的 DataRow 对象的数组。
备注
若要形成 filterExpression 参数,请使用与创建 DataColumn 类的 Expression 属性值相同的规则。Sort 参数也使用与创建类的 Expression 字符串相同的规则。
示例
private void GetRowsByFilter()
{
DataTable table = DataSet1.Tables["Orders"];
// Presuming the DataTable has a column named Date.
string expression = "Date > 1/1/00 ";
// Sort descending by column named CompanyName.
string sortOrder = "CompanyName DESC";
DataRow[] foundRows;
// Use the Select method to find all rows matching the filter.
foundRows = table.Select(expression, sortOrder);
// Print column 0 of each returned row.
for(int i = 0; i < foundRows.Length; i ++)
{
Console.WriteLine(foundRows[i][0]);
}
}
- 上一篇:cstr用法
- 下一篇:datatable.select(string) 含义
-
2021-07-01JS去掉字符串末尾字符的方法
-
2019-11-18JavaScript 比较运算符/逻辑运算符/类型运算符
-
2010-12-09什么是nofollow?
-
2010-12-09热搜关键词是什么意思?
-
2024-11-27object-fit:掌控替换元素尺寸属性
-
2014-06-23Graphics 类
