Sathish Kothandam
Sathish Kothandam

Reputation: 1520

Datetime error in Vb.net

Can some one help me to fix this error ..Not able declare a datetime

enter image description here

Upvotes: 0

Views: 1787

Answers (4)

bansi
bansi

Reputation: 56982

You have to declare DateTime with its full NameSpace as System.DateTime . This is because your application NameSpace is also Datetime and is the default. VB is not case sensitive so when you declare Datetime it refers to your application NameSpace.

Upvotes: 2

Guanxi
Guanxi

Reputation: 3131

Change Datetime to DateTime.

And you are getting DateTime converted as Datetime coz your project's name is Datetime, so your immediate class name or namespace would also be Datetime. Change your class name or else use Date or else use fully qualified name for DateTime.

Upvotes: 5

Dai
Dai

Reputation: 155075

The .NET type name is DateTime (not the capital 'T', VB is case-sensitive about type names).

VB.NET has a type alias called Date (which is not case sensitive).

However Datetime is not valid, so just correct it to DateTime

Upvotes: 0

Bhupendra
Bhupendra

Reputation: 1743

The type is DateTime with capital 'T' and not Datetime refer msdn link

Upvotes: 0

Related Questions