VBNET Overload because no accessible 'int' accepts number arguments

纵饮孤独 提交于 2020-01-25 14:08:20

问题


I'm getting this visual basic 2010 error : Overload resolution failed because no accessible int accepts number arguments. Error at line2 'int'

Private Sub cmdadd_Click(sender As System.Object, e As System.EventArgs) Handles cmdadd.Click
    Dim i As Integer = Int.Parse(txtqfire.Text)
    i += 1
    txtqfire.Text = i.ToString()
End Sub

回答1:


This is vb.net isn't it?

It should be:

Integer.Parse(txtqfire.Text)

You can also use:

Int32.Parse(txtqfire.Text)



回答2:


There is no such method in VB.NET (unlike c#).

The VB.NET conversion is:

Integer.Parse(txtqfire.Text)


来源:https://stackoverflow.com/questions/19153907/vbnet-overload-because-no-accessible-int-accepts-number-arguments

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!