Warning: Access of shared member, constant member, ...

brechtjah

Member
Joined
Mar 23, 2008
Messages
23
Programming Experience
Beginner
I keep getting this warning when I'm doing something that appears very normal to me. I really have no idea how I can get this away, and since you should treat warnings as errors I want this gone. The warning I get is: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.

It's about this piece of code:
lblHuidigePlanning.Text = dteDatumAanpassing.Today

where lblHuidigePlanning is a label in which I want the date that the user picked to come. dteDatumAanpassing (the date) is a global variable.
I don't get what I'm doing wrong.
If you guys could help me with this I promise I'll stop posting for today :p

Thanks
 
"Today" is a shared property of DateTime structure, which represents the Date data type, the only appropriate way to use it is to write "Date.Today". DateTime has loads of members, read through the list and see if you find something useful.
 
Back
Top