Re: Place of BeginTransaction in code
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Tue, 10 Oct 2006 19:44:53 +0200
This is only valid for member variables, local need to be explicitely
assigned/initialized, though failing to do so results in a compiler error .
Willy.
"Marina Levit [MVP]" <someone@xxxxxxxxxx> wrote in message
news:%23PkxvGJ7GHA.4996@xxxxxxxxxxxxxxxxxxxxxxx
| Yes, it is. A variable that is an object, is initially not pointing to
| anything- a.k.a null.
|
| Declare a variable and try to use it without instantiating it - you will
| get a NullReferenceException.
| Declare the same variable and point it to null and try to use it - you
will
| get a NullReferenceException.
|
| This applies to objects, not structures.
|
| "Mark Wilden" <mwilden@xxxxxxxxxxxxxxxx> wrote in message
| news:eE01qCJ7GHA.3280@xxxxxxxxxxxxxxxxxxxxxxx
| > "Marina Levit [MVP]" <someone@xxxxxxxxxx> wrote in message
| > news:%23sbQhyH7GHA.4500@xxxxxxxxxxxxxxxxxxxxxxx
| >
| >> Whether or not you set it to null is irrelevant. When you declare a
| >> variable, it is already null.
| >
| > Actually, I don't believe that's true, is it?
| >
| > ///ark
| >
| >
|
|
.
- Follow-Ups:
- Re: Place of BeginTransaction in code
- From: Marina Levit [MVP]
- Re: Place of BeginTransaction in code
- References:
- Place of BeginTransaction in code
- From: Mukesh
- Re: Place of BeginTransaction in code
- From: Marina Levit [MVP]
- Re: Place of BeginTransaction in code
- From: Mukesh
- Re: Place of BeginTransaction in code
- From: Marina Levit [MVP]
- Re: Place of BeginTransaction in code
- From: Mark Wilden
- Re: Place of BeginTransaction in code
- From: Marina Levit [MVP]
- Place of BeginTransaction in code
- Prev by Date: Javascript to C#
- Next by Date: Re: Decoding strategy
- Previous by thread: Re: Place of BeginTransaction in code
- Next by thread: Re: Place of BeginTransaction in code
- Index(es):
Relevant Pages
|