我知道我在这里是个白痴,我就是搞不定。但我正在尝试从 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