Null changed to Nothing in Visual Studio 2008

in many example i found in the internet it seems doesn’t work in my VS 2008, they code always has blue line under the Null word.

on the pop up they said:

‘Null’ is not declared, ‘Null’ constant is no longer supported; use system.DBNull instead

you can change the ‘Null’ value using ‘Nothing’ or use like what being recommended, ‘DBNull.value’ so the new code should be:

datlastdayakhir = DateTime.ParseExact(tanggalakhir, “MM/dd/yyyy”, Nothing)


datlastdayakhir = DateTime.ParseExact(tanggalakhir, “MM/dd/yyyy”, DBNull.Value)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s