473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

if statement question

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
Nov 18 '05 #1
5 961
what language are you using....?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
<me@privacy.net> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #2
<me@privacy.net> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
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.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #3
On Tue, 1 Jun 2004 17:09:06 -0400, <me@privacy.net> wrote:
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
Nov 18 '05 #4
sorry - I didn't say what language - it's vb.net.
SC
"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:Or**************@TK2MSFTNGP10.phx.gbl...
<me@privacy.net> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
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.
--
John Saunders
johnwsaundersiii at hotmail

Nov 18 '05 #5
<me@privacy.net> wrote in message
news:uo**************@tk2msftngp13.phx.gbl...
sorry - I didn't say what language - it's vb.net.


Ok, then SELECT CASE should work fine.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Greg Ofiesh | last post by:
Anyone who can help, I have two tables T1 and T2. T1 has fields K1 and F2 and T2 has fields K2 and F1. F1 is the foreign key relating to K1 and F2 is the foreign key relating to K2. My...
94
by: John Bailo | last post by:
The c# *return* statement has been bothering me the past few months. I don't like the fact that you can have different code paths in a method and have multiple return statements. To me, it...
9
by: Michael | last post by:
Hi all, I would like to get people's opinion about executing SQL statements in C# (or any other .NET language really). I used to create my SQL statement by building a string and replacing single...
7
by: Steven Bethard | last post by:
I've updated PEP 359 with a bunch of the recent suggestions. The patch is available at: http://bugs.python.org/1472459 and I've pasted the full text below. I've tried to be more explicit about...
1
by: javedna | last post by:
Can PHP help with the following as I have tried in the MYSQL Forums and cant get any help Thanks Nabz ---------------------------------------- Hi I am developing a PHP MYSQL questionnaire...
26
by: a.mil | last post by:
I am programming for code-speed, not for ansi or other nice-guy stuff and I encountered the following problem: When I have a for loop like this: b=b0; for (a=0,i=0;i<100;i++,b--) { if (b%i)...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
23
by: florian.loitsch | last post by:
According to the spec Section 14 the production SourceElements:SourceElements SourceElement is evaluated as follows: 1. Evaluate SourceElements. 2. If Result(1) is an abrupt completion, return...
21
beacon
by: beacon | last post by:
Hello to everybody, I have a section on a form that has 10 questions, numbered 1-10, with 3 option buttons per question. Each of the option buttons have the same response (Yes, No, Don't know),...
10
by: JohnO | last post by:
Hi All, This question is related to iSeries V5R4 and db2. I want to implement an AFTER DELETE trigger to save the deleted rows to an archive table, I initially defined it as a FOR EACH...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.