我的代碼塊在下面。事實證明,rdrCurrentRate.GetString(12)是一個空值,但代碼塊會引發錯誤。 「數據爲空,此方法或屬性不能在空值上調用。」VB.net如果塊拋出錯誤
我的本意是寫 「如果rdrCurrentRate.GetString(12)NOT NULL,則sCurrentRateType = rdrCurrentRate.GetString(12)」
缺少什麼我在這裏?
If Not String.IsNullOrEmpty(rdrCurrentRate.GetString(12)) Then
sCurrentRateType = rdrCurrentRate.GetString(12)
End If
什麼是錯誤? – 2011-03-22 19:46:27
「數據爲空,此方法或屬性不能在空值上調用。」 – user279521 2011-03-22 19:47:45