I need to change what rows are grabbed from the database based upon a few flags. How can I do this? My current code is like this:
this.tblTenantTableAdapter.Fill(this.rentalEaseDataSet.tblTenant);
Say if I wanted only rows that the id was greater than 50, how would I do that?
Edit:
The code to access the database was autogenerated by the original programmer a long time ago though VisualStudio. I don’t know exactly how to get a connection from the autogenerated code. If I could do that I know how to use the SqlDataAdapter
Why wouldn’t you use a
WHEREclause in your SQL query?Also, I would hope you don’t use your
IDfield for anything like this. If you just want the first 50 selections, you may want to use aTOP 50clause or something similar.For some info on how to do this with your TableAdapter: http://www.shiningstar.net/ASPNet_Articles/DataSet/DataSetProject7.aspx