"Aryan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
The data in your table probably isn't in integer form. Depends on you xml
schema if you have one. If not they are probably all text type. Depending on
how much you are using the data you might also want to look into serializing
your xml and putting the data into a class that inherits the arraylist. This
article may be of some assistants (read part one and two).
http://aspnet.4guysfromrolla.com/articles/102302-1.aspx
Mike