"John" <Jo**@nospam.infovis.co.ukwrote in message
news:OJ**************@TK2MSFTNGP04.phx.gbl...
:
: Hi
:
: After importing my vs 2003 project into vs 2005 I am getting the
: error Name '_DateColumn' is not CLS-compliant. on the second line
: of below code;
:
: <System.Diagnostics.DebuggerNonUserCodeAttribute() _
: Public ReadOnly Property _DateColumn() As System.Data.DataColumn
: Get
: Return Me.column_Date
: End Get
: End Property
:
: What does that mean and how can I fix it? I suspect this code was
: generated by vs 2003 itself.
:
: Regards
It's the underscore.
http://msdn2.microsoft.com/en-us/library/k5645wwb.aspx
It's due the the fact that there are C/C++ compilers for .Net. In
these languages, names with leading underscore characters are reserved
for the "implementation" under certain specific rules (I've seen "the
implementation" defined as anything other than the code the programmer
is writing, btw). It states in the SDK documentation regarding
variable names in the C++ language:
Use of two sequential underscore characters ( __ ) at the
beginning of an identifier, or a single leading underscore
followed by a capital letter, is reserved for C++ implementations
in all scopes. You should avoid using one leading underscore
followed by a lowercase letter for names with file scope because
of possible conflicts with current or future reserved identifiers.
Since VB is not case sensitive, "_DateColumn" and "_dateColumn" are
identical. However, in C/C++/C# they are not. The first version of the
name is not legal in C++ but the second version is (although
discouraged). Since VB doesn't differentiate by case, neither version
is considered CLS compliant.
Ralf
--
--
----------------------------------------------------------
* ^~^ ^~^ *
* _ {~ ~} {~ ~} _ *
* /_``>*< >*<''_\ *
* (\--_)++) (++(_--/) *
----------------------------------------------------------
There are no advanced students in Aikido - there are only
competent beginners. There are no advanced techniques -
only the correct application of basic principles.