vb.net winform 运行时“创建窗体出错”,毕业答辩在即,急等良策
- VB.NET code
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
注:代码和图片如上,是一个登录界面,然后输入用户名、密码后切换到form2窗体,今天添加了一个新的form39窗体后,保存运行时,却出现了上述错误,以前一两个月来,登录切换到form2从来没有什么问题,毕业设计审查在即,急啊...........
[解决办法]
Form2本身有问题
[解决办法]
......这个问题百度去吧