现在的位置: 首页 > 综合 > 正文

DataTable.Select(“Date > #1/1/00#”)

2013年06月29日 ⁄ 综合 ⁄ 共 666字 ⁄ 字号 评论关闭
DataRow[] priceDetailCheckRow = priceDetailCheckExistTable.Select("effective_from = #" + effectiveFromDate.ToString(DateFormat) + "#");     

来自于MSDN
http://msdn2.microsoft.com/en-us/library/det4aw50.aspx

private void GetRowsByFilter()
{
    DataTable table 
= DataSet1.Tables["Orders"];
    
// Presuming the DataTable has a column named Date.
    string expression;
    expression 
= "Date > #1/1/00#";
    DataRow[] foundRows;

    
// Use the Select method to find all rows matching the filter.
    foundRows = table.Select(expression);

    
// Print column 0 of each returned row.
    for(int i = 0; i < foundRows.Length; i ++)
    
{
        Console.WriteLine(foundRows[i][
0]);
    }

}

【上篇】
【下篇】

抱歉!评论已关闭.