Non-invocable member cannot be used like a method?

前端 未结 4 1826
醉话见心
醉话见心 2020-12-16 08:42

I keep getting the following errors in my program:

\'System.Windows.Forms.TextBox.Text\' is a \'property\' but used like a \'method\'

and

4条回答
  •  情歌与酒
    2020-12-16 09:37

    I had the same issue and realized that removing the parentheses worked. Sometimes having someone else read your code can be useful if you have been the only one working on it for some time.

    E.g.

      cmd.CommandType = CommandType.Text(); 
    

    Replace: cmd.CommandType = CommandType.Text;

提交回复
热议问题