我无法将已记录的用户信息检索到form2

时间:2018-05-10 20:08:27

标签: vb.net

正如标题所说,我无法将记录的用户信息提供给form2。我正在使用访问数据库。

这是我的代码:

Public Class Form1
    Public id, pw, bal, nme As String

    Private Sub CardBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles CardBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.CardBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.KartDataSet)
    End Sub

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        id = Card_IDTextBox.Text
        pw = PasswordTextBox.Text

        Dim login = CardTableAdapter.IDPW(id, pw)

        If login Is Nothing Then
            MsgBox("Check ID or PW")
        Else
            MsgBox("Welcome, now you are connecting.")
            Form2.Show()
            bal = Form2.BalanceTextBox.Text
            nme = Form2.UserTextBox.Text
        End If
    End Sub
End Class

我做错了什么?

0 个答案:

没有答案