错误:属性访问必须分配给该属性或使用其值. [英] Error :Property access must assign to the property or use its value.

查看:380
本文介绍了错误:属性访问必须分配给该属性或使用其值.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai我的代码中有错误,目前我正在创建Windows窗体来添加人员,在我的程序中我创建了按钮,使用文本框来添加数据,而在尝试运行时出现此错误必须分配属性访问权限或使用其值..请帮助我

Hai i have an error in my code , curently i am creating windows form to add staff, in my programe i created button , textbox to add data , while am try to run i got this error Property access must assign to the property or use its value..Please help me

Private Sub btnregister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnregister.Click
        admin1.LoginDataSet.staff(Me.NAMETextBox.Text, Me.TELEPHONEMaskedTextBox.Text, Me.I_CMaskedTextBox.Text, Me.USERNAMETextBox1.Text, Me.PASSWORDTextBox.Text, Me.ADDRESSTextBox.Text)
        MsgBox("Register Completed")
        admin1.StaffTableAdapter.Fill(admin1.LoginDataSet.staff)
    End Sub
End Class

推荐答案

了解不是很困难.显然,"Staff"是LoginDataSet的属性,而不是方法.您正试图像调用方法一样调用属性,但这是行不通的.

员工应被称为:
It''s not very idfficult to understand. Apparently "Staff" is a property of LoginDataSet, not a method. You''re trying to call a property like it was a method and that just doesn''t work.

Staff is expected to be called something like:
admin1.LoginDataSet.Staff = something


这篇关于错误:属性访问必须分配给该属性或使用其值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆