C# uses null (all lowercase). But if you don't initialize a variable it's
going to have an undefined value, make sure you set objConn before you check
it for null (such as in a constructor). If it's an instance variable then it
is going to have a default value but it's better not to rely on that and
always set your variables before using them.
Jerry
"Will" <ws*****@comcast.net> wrote in message
news:08****************************@phx.gbl...
what is the equivalent in C# to VB's Is Nothing? Check out
the following code snippet:
private SqlConnection objConn;
if (objConn Is Nothing) {
objConn = new SqlConnection(strConnection);
}
I'm converting my coded from vb to C# and I want to
replace objConn Is Nothing with the C# equivalent? I
trried == NULL, but C# doesn't know NULL. Thanks