Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datatable select problems

Status
Not open for further replies.

bopritchard

Programmer
Jan 27, 2003
199
US
the table my dsExaminers dataset reads from has column display (of type int) that all of the values are 0...yet after applying this select method it still contains the values with 0 in the display field...what gives?

string strSelect = "display = 1";
dsExaminers.Tables[0].Select(strSelect);
 
The Select method does not filter or get rid of the rows in the DataTable itself, it just returns a set of rows that meet the condition. I think what you are after is DataView.RowFilter if you are displaying this data in a grid.

More information:
Code:
//Intialized elsewhere
DataGrid grd;

dsExaminers.Tables[0].DefaultView.RowFilter = "display = 1";
grd.DataSource = dsExaminers.Tables[0].DefaultView;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top