vb.net winform 运行时“创建窗体出错”,毕业答辩在即,急等良策

itzyx 2012-05-03 11:32:19
 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从来没有什么问题,毕业设计审查在即,急啊...........
...全文
103 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Ever_lover 2012-05-03
  • 打赏
  • 举报
回复
......这个问题百度去吧
ccccffff 2012-05-03
  • 打赏
  • 举报
回复
Form2本身有问题

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧