Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is Nothing Equivalent?

Reply
Thread Tools

Is Nothing Equivalent?

 
 
Adam J Knight
Guest
Posts: n/a
 
      01-29-2006
Hi all,

Can anyone fill me in on the C# equivalent of this VB statement?

If Not (Request.QueryString("myQString") Is Nothing) Then 'Do Something

Cheers,
Adam


 
Reply With Quote
 
 
 
 
CedricCicada@gmail.com
Guest
Posts: n/a
 
      01-29-2006
How about:
if (!Request.QueryString("myQString") == null)
{
DoSomething();
}

I'm pretty sure that's right. You don't really need the curly braces
if you only have a single statement, but I always put them in, since
it's easy to forget to add them when you add a second line to the if
block and they're not already there.

RobR

 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      01-29-2006
This will also do it...

if (!(Request.QueryString["myQString"] == null))
{
// Do something
}



Juan T. Llibre
ASP.NET MVP
ASPNETFAQ.COM : http://www.aspnetfaq.com
==================================
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> How about:
> if (!Request.QueryString("myQString") == null)
> {
> DoSomething();
> }
>
> I'm pretty sure that's right. You don't really need the curly braces
> if you only have a single statement, but I always put them in, since
> it's easy to forget to add them when you add a second line to the if
> block and they're not already there.
>
> RobR
>




 
Reply With Quote
 
Chris R. Timmons
Guest
Posts: n/a
 
      01-29-2006
"Adam J Knight" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Hi all,
>
> Can anyone fill me in on the C# equivalent of this VB statement?
>
> If Not (Request.QueryString("myQString") Is Nothing) Then 'Do
> Something


Adam,

if (Request.QueryString("myQString") != null)
// Do Something

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
 
Reply With Quote
 
Sonu Kapoor
Guest
Posts: n/a
 
      01-29-2006
http://www.carlosag.net/Tools/CodeTr...r/Default.aspx

Sonu Kapoor [MVP]
---
Posted via www.DotNetSlackers.com
 
Reply With Quote
 
=?Utf-8?B?RGF2aWQgQW50b24=?=
Guest
Posts: n/a
 
      01-29-2006
"carlosag" is easily the best on-line converter that I've seen.

If you want to convert entire projects or would like additional features
like conversion of VB or C# code within ASP.NET pages, then you'll need to
check out the commercial converters (including us of course).

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter



"Sonu Kapoor" wrote:

> http://www.carlosag.net/Tools/CodeTr...r/Default.aspx
>
> Sonu Kapoor [MVP]
> ---
> Posted via www.DotNetSlackers.com
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
re module: Nothing to repeat, but no sre_constants.error: nothing torepeat ? Devin Jeanpierre Python 2 02-14-2012 01:33 PM
Ad Hoc Problem: ping works, nothing else does! =?Utf-8?B?a2F2YVh0cmVtZQ==?= Wireless Networking 0 12-02-2004 03:45 PM
show running returns nothing, routing stops Richard Antony Burton Cisco 10 11-25-2003 10:39 AM
cisco 3640, show running-config gives nothing Chad Whitten Cisco 1 11-12-2003 11:49 PM
setting to Nothing Mark Kamoski ASP .Net 1 08-07-2003 10:58 PM



Advertisments