Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing dataset by reference
Message
From
12/03/2012 11:05:37
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01538045
Message ID:
01538052
Views:
34
>Hi,
>
>Here is a segment of code:
>
>
>DataSet ds = new DataSet();
>MyClass.MyMethod( ds );
>
>if (ds =!null)
>{
>    // Error message. Since ds is null.  But why the above ds =! null does not catch it? 
>}
>
>MyClass.MyMethod( DataSet ds)
>{
>     // for testing
>     ds = null;
>}
>
>
>Why does the line ds =! null does not catch that the ds is null?
>
>I also tried to declare the parameter ds as Out but it does not work either.


Change
>if (ds =!null)
into
if (ds == null)
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform