我知道我在這裏是一個白癡,我只是不能解決它。但我試圖從vb.net數據庫中取回一些數據。它沒有被設置爲對象錯誤的實例,而是落在了對象引用上。在代碼運行之前,它說變量在被設置之前被使用,但是我看不到。代碼:VB.net數據庫連接空引用
Private taNotifications As dsDataTableAdapters.NotificationsTableAdapter = New dsDataTableAdapters.NotificationsTableAdapter
Dim notification As dsData.NotificationsDataTable = taNotifications.GetDataByClientID(userrow.UserID)
If notification.Rows.Count > 0 Then
Dim notificationrow As dsData.NotificationsRow
Dim forwardURL As String = notificationrow.ForwardLocation
End If
它在Dim forwardURL As String = notificationrow.ForwardLocation
非常感謝!真的很有幫助 – TMB87