vb.net - 不断出现错误,“非静态方法需要一个目标
问题描述
即使我确保我正在使用的 var 是共享的并且不为空,我仍然会收到非静态错误。
Using context = New iTracContext
Dim trainingRec As TrainingRecord = context.TrainingRecords.Include("TrainingReference").Include("Employee").SingleOrDefault(Function(r) r.ReferenceID = CurrentReference.id And r.Employee.eid = CurrentEmployee.eid And r.due_date.Year = TrainingManagerForm.YR)
If Not trainingRec Is Nothing Then
Dim msg As String = "This module "
msg = msg + trainingRec.TrainingReference.name + " is currently assigned to this employee with a Due Date of " + trainingRec.due_date
MsgBox(msg, vbOKOnly, "Module Not Added")
x = x + 1
End If
End Using
解决方案
推荐阅读
- c - C99/C11 中的两个结构可以别名吗?
- python - Kerastuner Randomsearch:TypeError:('关键字参数不理解:','激活')
- node.js - AWS Ubuntu 18.04 AMI 上的 NVM 加载失败
- numpy - AttributeError:“NoneType”对象在 jupyter 笔记本上没有属性“形状”
- ruby-on-rails - 查询对象方法等于特定值的位置
- python-3.x - 熊猫计算跨行条件的每月发生次数
- angular - 如何订阅 AngularFire 文档
- reactjs - 保存数据并在另一个页面获取 - React Native
- javascript - 是否应该将函数包装为异步
- java - 如何使用 Selenium 在 Safari 浏览器上处理身份验证弹出窗口?