使用此代码,我收到一条错误消息,指出“SelectCommand”不是 StudentTableAdapter 的成员。
Dim cmd As New SqlCommand("SELECT * FROM Students WHERE ID=@ID", myConnection)
cmd.Parameters.AddWithValue("@ID", 5)
Me.StudentsTableAdapter.SelectCommand = cmd
Me.StudentsTableAdapter.Fill(Me.StudentsDataSet.Students)
连接对象是这个:
Dim ObjConnection As New SqlConnection(My.Settings.SelimiyeMasjidConnectionString)
你能告诉我如何使 SelectCommand 成为表适配器的成员吗?