if statement question

G

Guest

is there anything like a SQL IN statement

where x in ('123','456',789')....

available in an IF statment in aspnet?

I've got a number of possibilities for a session variable to be set equal
to, and want to avoid calling this routine if it's one of these reports. I
didn't want to have a 20 line long IF statement, but not sure how I can do
this.

any advice?

SC
 
J

John Saunders

is there anything like a SQL IN statement

where x in ('123','456',789')....

available in an IF statment in aspnet?

I've got a number of possibilities for a session variable to be set equal
to, and want to avoid calling this routine if it's one of these reports. I
didn't want to have a 20 line long IF statement, but not sure how I can do
this.

any advice?

This would depend on the language you're using, wouldn't it?

ASP.NET is not a particular language. ASP.NET pages may be written in VB.NET
or C#, or just about any other language supporting .NET.
 
D

Dan Brussee

is there anything like a SQL IN statement

where x in ('123','456',789')....

available in an IF statment in aspnet?

I've got a number of possibilities for a session variable to be set equal
to, and want to avoid calling this routine if it's one of these reports. I
didn't want to have a 20 line long IF statement, but not sure how I can do
this.

Not always the most concise, but, assuming vb.net (c# has a similar
thing)...

select case x
case "123", "456", 789"
' do something
case "abc", "def", "hij"
' do something else
end select
 

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

Similar Threads


Top