开发者

Datatable select concat two columns

I have some data in the datatable there are two columns that are year and month that I need to concat and select the data

it should be some thing like this

DataTable dt;
string expression = 开发者_JS百科(year,month)=(2009,03)
dt.Select(expression);

The above syntax is an example of what I want to achieve .

For further clarification I have the data in data table as

year | Month
2009   03
2010   04
2010   05

So the above select should fetch me one row.


you can get this by

dt.DefaultView.RowFilter = "year='2009' AND Month='03'";

Now dt.DefaultView will return you one row or rows matching your criteria

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜