0

为什么我会出现这种错误。我一直在练习教程,但我仍然明白这一点。应该如何清除这个错误。我已经开始练习.net。所以请指导我

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim std As DataSet1TableAdapters.studentTableAdapter

    If txtname.Text = "" Then
        lblMessage.Text = "Please enter name"
    ElseIf txtclass.Text = "" Then
        lblMessage.Text = "Please enter class "
    ElseIf txtsemseter.Text = "" Then
        lblMessage.Text = "Please enter semester"
    Else
        std.Insert(Name:=txtname.Text, Class:=txtclass.Text, Semester:=txtsemseter.Text)
    End If
End Sub

教程链接:http ://www.youtube.com/watch?v=wDFo-nGdUQY

4

2 回答 2

2

做如下

Dim std As New DataSet1TableAdapters.studentTableAdapter()

当你打电话时,std.Insert你需要有对象DataSet1TableAdapters.studentTableAdapter

于 2013-07-29T10:57:17.717 回答
0

您需要更新变量,如下所示:

Dim std As New DataSet1TableAdapters.studentTableAdapter()

编辑:我试图在手机上做到这一点,不容易:)

于 2013-07-29T11:00:32.810 回答