datatable filter
-
I have a datatable(code behind datatable class) that contains a column with the name aa which have ulphanumeric values. Is there any way to find those rows having numeric values onlywithout doing iteration ?
The
Select
method of theDataTable
class allows you to do just that, using pseudo T-SQL. It returns an array ofDataRow
. E.g.:DataRow[] results = yourDataTable.Select("aa=15");
var question = (_2b || !(_2b));
-
The
Select
method of theDataTable
class allows you to do just that, using pseudo T-SQL. It returns an array ofDataRow
. E.g.:DataRow[] results = yourDataTable.Select("aa=15");
var question = (_2b || !(_2b));
Thanks for replying.. :)
Greg Chelstowski wrote:
DataRow[] results = yourDataTable.Select("aa=15");
I have to check it at runtime, and there is no static value as written by you in query. the datatable can have any number of both numeric, alphanumeric records. Please suggest something.
-
Thanks for replying.. :)
Greg Chelstowski wrote:
DataRow[] results = yourDataTable.Select("aa=15");
I have to check it at runtime, and there is no static value as written by you in query. the datatable can have any number of both numeric, alphanumeric records. Please suggest something.
abcurl wrote:
I have to check it at runtime
???
abcurl wrote:
and there is no static value as written by you in query
Then use variables. And by static I'm sure you meant hard-coded.
abcurl wrote:
the datatable can have any number of both numeric, alphanumeric records.
Use single quotes in the query then! Now, once you actually got your DataRow array, I'm sure you'll be asking next how to extract values from it. Look, do some reading on MSDN, there are a million tutorials and examples on the .Select method of DataTable.
var question = (_2b || !(_2b));
-
abcurl wrote:
I have to check it at runtime
???
abcurl wrote:
and there is no static value as written by you in query
Then use variables. And by static I'm sure you meant hard-coded.
abcurl wrote:
the datatable can have any number of both numeric, alphanumeric records.
Use single quotes in the query then! Now, once you actually got your DataRow array, I'm sure you'll be asking next how to extract values from it. Look, do some reading on MSDN, there are a million tutorials and examples on the .Select method of DataTable.
var question = (_2b || !(_2b));
If possible try to use the Regex. May be it helps solving your problem.