Retrieving DataTable results programmatically

  • Thread starter Thread starter Barry
  • Start date Start date
B

Barry

Hi

I am using DataTable/DataSet in VS 2005, The sql statement is coded in
script, i want to know how to retrteve results by changing the SQL
commandtext progrmmatically

something like this (possibly)
dsSearchOperators.Operator.Select("State='CA'");

or

using the SQL Statement modified internally like this

dsSearchOperators.commandtext = "SELECT * FROM XX where State='CA'";

note 2nd one is fictitious

TIA
Barry
 
Hi

I am using DataTable/DataSet in VS 2005, The sql statement is coded in
script, i want to know how to retrteve results by changing the SQL
commandtext progrmmatically

something like this (possibly)
dsSearchOperators.Operator.Select("State='CA'");

or

using the SQL Statement modified internally like this

dsSearchOperators.commandtext = "SELECT * FROM XX where State='CA'";

note 2nd one is fictitious

TIA
Barry

If you want to change the sql statement, that will have to be done at the
data adapter level.

If, however, you want to filter results that have already been returned,
you could use a DataView and set its RowFilter property to filter the data
 
Back
Top