Is there any way to do a DataSet.Select() statement and use more than one
selection "query"? For instance, instead of just selecting all rows where
the IDNum is greater than 32 with DataSet.Select("IDNum > 32"), select all
rows where the IDNum > 32 and the Region = Midwest. Is this possible?

Re: DataSet.Select by Jay

Jay
Wed Jan 21 08:12:10 CST 2004

Nathan,
DataSet does not have a Select method, do you mean DataTable.Select?

The only place I know of where the syntax that expressions in the DataSet OM
is documented is the DataColumn.Expression help topic:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataDataColumnClassExpressionTopic.asp

There is an AND operator so you can use something like:

Dim table As DataTable
Dim rows() As DataRow
rows = table.Select("IDNum > 32 And Region = 'Midwest')

Hope this helps
Jay

"Nathan" <nkmacgregor.TakeThisOut@softhome.net> wrote in message
news:O6xNBfC4DHA.876@TK2MSFTNGP10.phx.gbl...
> Is there any way to do a DataSet.Select() statement and use more than one
> selection "query"? For instance, instead of just selecting all rows where
> the IDNum is greater than 32 with DataSet.Select("IDNum > 32"), select all
> rows where the IDNum > 32 and the Region = Midwest. Is this possible?
>
>



Re: DataSet.Select by Jan

Jan
Wed Jan 21 08:14:05 CST 2004

Sure, you can use the AND operator:

myDataTable.Select("IDNum > 32 AND Region = "MidWest")



More info:

http://tinyurl.com/2cvqh

Concatenation is allowed using Boolean AND, OR, and NOT operators. You can
use parentheses to group clauses and force precedence. The AND operator has
precedence over other operators. For example:

(LastName = 'Smith' OR LastName = 'Jones') AND FirstName = 'John'


--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


"Nathan" <nkmacgregor.TakeThisOut@softhome.net> wrote in message
news:O6xNBfC4DHA.876@TK2MSFTNGP10.phx.gbl...
> Is there any way to do a DataSet.Select() statement and use more than one
> selection "query"? For instance, instead of just selecting all rows where
> the IDNum is greater than 32 with DataSet.Select("IDNum > 32"), select all
> rows where the IDNum > 32 and the Region = Midwest. Is this possible?
>
>



Re: DataSet.Select by Miha

Miha
Wed Jan 21 08:29:44 CST 2004

Hi Jan,

"Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
news:uQVZVjC4DHA.1724@TK2MSFTNGP09.phx.gbl...
> Sure, you can use the AND operator:
>
> myDataTable.Select("IDNum > 32 AND Region = "MidWest")

Forgot singe parenthesis? :)
... Region = 'MidWest'")

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com



Re: DataSet.Select by Jan

Jan
Wed Jan 21 08:36:50 CST 2004

Yes indeed! Thanks!
myDataTable.Select("IDNum > 32 AND Region = 'MidWest' ")
--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


"Miha Markic" <miha at rthand com> wrote in message
news:ugHjAsC4DHA.2700@tk2msftngp13.phx.gbl...
> Hi Jan,
>
> "Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
> news:uQVZVjC4DHA.1724@TK2MSFTNGP09.phx.gbl...
> > Sure, you can use the AND operator:
> >
> > myDataTable.Select("IDNum > 32 AND Region = "MidWest")
>
> Forgot singe parenthesis? :)
> ... Region = 'MidWest'")
>
> --
> Miha Markic - RightHand .NET consulting & software development
> miha at rthand com
> www.rthand.com
>
>



OT: Re: DataSet.Select by Cor

Cor
Wed Jan 21 08:36:12 CST 2004

Hi Miha,

You have to be consequent, I do not do it with JayB, you saw it

:-)

Cor



Re: DataSet.Select by Armin

Armin
Wed Jan 21 08:43:36 CST 2004

"Nathan" <nkmacgregor.TakeThisOut@softhome.net> schrieb
> Is there any way to do a DataSet.Select() statement and use more than
> one selection "query"? For instance, instead of just selecting all
> rows where the IDNum is greater than 32 with DataSet.Select("IDNum >
> 32"), select all rows where the IDNum > 32 and the Region = Midwest.
> Is this possible?

You mean Datatable.select? Yes, you can use the And operator. See the help
for System.Data.DataColumn.Expression explaining the syntax.


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


Re: Re: DataSet.Select by Miha

Miha
Wed Jan 21 09:10:46 CST 2004


"Cor" <non@non.com> wrote in message
news:eLbZxwC4DHA.1936@TK2MSFTNGP12.phx.gbl...
> Hi Miha,
>
> You have to be consequent, I do not do it with JayB, you saw it

Overlooked that :)

> :-)

I know that Jan knows what he is writting and it was only a typo :)

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com



OT: Re: DataSet.Select by CJ

CJ
Wed Jan 21 09:50:46 CST 2004


"Miha Markic" <miha at rthand com> wrote in message
news:ugHjAsC4DHA.2700@tk2msftngp13.phx.gbl...
> Hi Jan,
>
> "Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
> news:uQVZVjC4DHA.1724@TK2MSFTNGP09.phx.gbl...
> > Sure, you can use the AND operator:
> >
> > myDataTable.Select("IDNum > 32 AND Region = "MidWest")
>
> Forgot singe parenthesis? :)

I believe the correct response was "single quote marks". The judges would
have also accepted apostrophe... yes.. apostrophe. =)

again... my 2 useless cents.


> ... Region = 'MidWest'")
>
> --
> Miha Markic - RightHand .NET consulting & software development
> miha at rthand com
> www.rthand.com
>
>



Re: Re: DataSet.Select by Jay

Jay
Wed Jan 21 18:53:24 CST 2004

Cor,
Doh! I see my sample had a typo also...

Odd that both samples had small typos... It must of been the phase of the
moon, yea that's it ;-)

Jay


"Cor" <non@non.com> wrote in message
news:eLbZxwC4DHA.1936@TK2MSFTNGP12.phx.gbl...
> Hi Miha,
>
> You have to be consequent, I do not do it with JayB, you saw it
>
> :-)
>
> Cor
>
>



Re: DataSet.Select by Nathan

Nathan
Wed Jan 21 12:00:01 CST 2004

Thanks for all the input -- this will make a lot of things easier for me. :)



Re: Re: DataSet.Select by Miha

Miha
Thu Jan 22 02:31:00 CST 2004

Hi,

"CJ Taylor" <nospam@blowgoats.com> wrote in message
news:100t7ukfn2h7l17@corp.supernews.com...
>
> "Miha Markic" <miha at rthand com> wrote in message
> news:ugHjAsC4DHA.2700@tk2msftngp13.phx.gbl...
> > Hi Jan,
> >
> > "Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
> > news:uQVZVjC4DHA.1724@TK2MSFTNGP09.phx.gbl...
> > > Sure, you can use the AND operator:
> > >
> > > myDataTable.Select("IDNum > 32 AND Region = "MidWest")
> >
> > Forgot singe parenthesis? :)
>
> I believe the correct response was "single quote marks". The judges would
> have also accepted apostrophe... yes.. apostrophe. =)

Ouch. I'll had to improve my english ;-)

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com