DataTable.Select problem in ASP.NET 2.0

M

manoj241176

Hi,
I am having problem with DataTable.Select() method. I am using
ASP.NET 2.0.
I have DataSet which reads data from XML file using DataSet.ReadXML().
Now this
dataset has various datatable, created by XML file. I am taking one of
the datatable
from this dataset and want to filter on that datatable using Select()
method.
Now here the problem start, like when I pass multiple "And" clause in
this method
it doesnt recognize that parameter and doesnt return the value, where
as it should return the value.
For Example,

DataTable has various rows containing data, now when i try to filter
this data, then
it should return me data for the passed criteria. But to my surprise
its not doing like this.
Although I have that data which I am passing as filter expression in
Select Method(). This
method works for some criteria and it doesnt work for some criteria.

For example: -

dim dt as datatable = ds.Tables("Report")
drow = dt.Select("id = 1 and number=5 and value=10")
//basically this should return me datarow, but its not returning any
datarow and returns 0 as count.
//but the same line of code works for some of the values.

I am not able to figure out what could be the problem, is this a bug
from Microsoft, as it
was there in ASP.NET 1.1.

Please help me out, as i dont want to use DataView.RowFilter property


Thanks in Advance,

Regards,
Manoj Singh.
 
C

Cor Ligthert [MVP]

Nano,

In aspNet 1.1 this was strangly enough not case intesitive as it was in
winforms.

However are you sure that all your values are numbers (int, double or like
that) and that all lower and uppercases from the identifiers are right used.
The select is very precise with that?

I would even try if and is allowed and that it has not to be AND

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top