Groups | Blog | Home
all groups > dotnet framework > december 2006 >

dotnet framework : Retrieving DataTable results programmatically


Barry
12/26/2006 12:00:00 AM
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

Rad [Visual C# MVP]
12/26/2006 12:00:00 AM
[quoted text, click to view]

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
--
Bits.Bytes
AddThis Social Bookmark Button