ConnectionString 属性尚未初始化的问题
程序代码:
Public Class 登陆界面 Dim objDataAdapter As New SqlDataAdapter Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sqlstr As String sqlstr = "select * from admin admin where userid=' " & Trim(TextBox1.Text) & "'and password='" & Trim(TextBox2.Text) & "'" Using connection As New SqlConnection() connection.Open() Dim da As New SqlDataAdapter(sqlstr, connection) Dim ds As New DataSet() da.Fill(ds) connection.Close() Dim t = ds.Tables(0) If ds.Tables(0).Rows.Count = 0 Then MsgBox("你输入的账号或密码错误!", , "提示") Else 主界面.Show() Me.Hide() End If End Using提示错误:ConnectionString 属性尚未初始化!登陆验证的问题!如何解决,而且这代码应该有其他问题!求指导啊!!!!急死了,就没人知道吗?发了那么多帖子没人回!