vb.net winform 运行时“创建窗体出错”,毕业答辩在即,急等良策
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myConnection As New SqlConnection("Data Source=ZYX-PC;Initial Catalog=tongrentang;Integrated Security=True") Dim strSql As String strSql = "select username,password from login where username='" & Me.TextBox1.Text & "' and password='" & Me.TextBox2.Text & "'" Dim myAdapter As New SqlDataAdapter(strSql, myConnection) Dim myDataset As New DataSet myAdapter.Fill(myDataset, "user") If myDataset.Tables("user").Rows.Count = 0 Then MsgBox("用户名或密码错误!") Me.TextBox1.Text = "" Me.TextBox2.Text = "" Me.TextBox1.Focus() Else Dim f2 As New Form2() Me.Hide() f2.Show() End If End Sub