连接SQL数据库问题
Dim str As Stringstr = "Data Source=local;Initial Catalog=财务管理;integrated Security=true"
Dim con As New SqlConnection(str)
con.Open()
Dim sql As String = "select * from 登录表 where user_name'" & TextBox1.Text.ToString().Trim() & "' and user_pwd'" & TextBox2.Text.ToString().Trim() & "' and User_des='" & ComboBox1.Text.ToString.Trim() & "' "
Dim cmd As New SqlCommand(sql, con)
Dim reader As SqlDataReader
reader = cmd.ExecuteReader
If reader.Read() = True Then
Me.Hide()
frm.Label1.Text =
frm.Show()
frm.Text = "欢迎您进入财务管理系统" & TextBox1.Text & "--" & ComboBox1.Text
Else
MsgBox("登录失败,请检查你用户名,密码,以及权限是否正确")
End If
请高手帮忙检查下,这个程序中哪里有错误,运行时con.Open()出现了错误,但是我不知道怎么改?