表达式是一个值,因此不能作为赋值的目标-asp.net
我得到了上面的错误。它是在开发模式下工作,但不是在现场,有什么想法吗 读卡器中有适当的值,因为我已将它们写入文本文件表达式是一个值,因此不能作为赋值的目标-asp.net,asp.net,Asp.net,我得到了上面的错误。它是在开发模式下工作,但不是在现场,有什么想法吗 读卡器中有适当的值,因为我已将它们写入文本文件 Do While reader.Read() personList.Add(New Person() With {.ID = reader("user_id"), .Name = reader("person")}) Loop 谢谢 Public Class Person Private m_ID As Integer P
Do While reader.Read()
personList.Add(New Person() With {.ID = reader("user_id"), .Name = reader("person")})
Loop
谢谢
Public Class Person
Private m_ID As Integer
Public Property ID() As Integer
Get
Return m_ID
End Get
Set(ByVal value As Integer)
m_ID = value
End Set
End Property
Private m_Name As String
Public Property Name() As String
Get
Return m_Name
End Get
Set(ByVal value As String)
m_Name = value
End Set
End Property
现在分类,只是用不同的方式。让新的构造函数获取参数并按这种方式设置。将它们作为可选的构造放在其他地方调用,不需要参数
Public Sub New(Optional ByVal uid As Integer = 0, Optional ByVal uname As String = "")
ID = uid
Name = uname
End Sub
Dim uid As Integer
Dim uname As String
Do While reader.Read()
uid = reader("user_id")
uname = reader("person")
personList.Add(New Person(uid, uname))
Loop
我们能看看班上的人吗?至少是财产。