Is Nothing Equivalent?

A

Adam J Knight

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
 
C

CedricCicada

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
 
C

Chris R. Timmons

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
 
G

Guest

"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
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top