连接SQL2005的问题!
Imports System.Data.SqlClientDim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim dr As SqlDataReader
Sub ConnectDataBase()
Try
myConnection = New SqlConnection("server=CHENGXU_PC\SQLEXPRESS;uid=;pwd=;database=Mail")
myConnection.Open()
myCommand = New SqlCommand("Select * from Mailfilter", myConnection)
dr = myCommand.ExecuteReader
Do
While dr.Read()
Console.WriteLine(dr(0))
Console.WriteLine(dr(1))
End While
Loop While dr.NextResult()
Catch
End Try
dr.Close() '此处报错
myConnection.Close()
End Sub
数据库登陆的方式是windows验证,用户名和密码都是灰色的
运行后报错
连接数据库采用的是的方法
请问怎么解决这个错误