Reputation: 2850
I want to search some data from DataTable to show in GridView.
Like
(select * from customer where id="1")
Can I do that?
Upvotes: 0
Views: 1508
Reputation: 5553
DataRow[] foundRows = yourTable.Select("id=1");
Or you can filter rows in default view:
yourTable.DefaultView.RowFilter = "id = 1";
GridView gv = new GridView();
gv.DataSourse = yourTable.DefaultView
gv.DataBind()
Upvotes: 1