here's a basic example for connecting, does this help?
'form a command that waits longer than 30 seconds for testing
Dim sqlcmd As String = "WaitFor Delay '00:00:45';SELECT name FROM sys.tables;"
Dim mySqlConnectionFormat As String = "data source={0};initial catalog={1};user id={2};password={3};Trusted_Connection=False;Connect Timeout=600;Application Name=GhostInTheMachine;"
Dim MyConn As New SqlConnection
MyConn.ConnectionString = String.Format(mySqlConnectionFormat, ".", "SandBox", "Noobie", "NotARealPassword")
MyConn.Open()
'now lets get a command object
Dim mySqlCommand As New SqlCommand
mySqlCommand.Connection = MyConn
mySqlCommand.CommandTimeout = 600
mySqlCommand.CommandType = CommandType.Text
mySqlCommand.CommandText = sqlcmd
Dim myDataReader As SqlDataReader
myDataReader = mySqlCommand.ExecuteReader
' could either loop thru the reader itself, or stick it into a datatable .
Dim MyDataTable As New DataTable
MyDataTable.Load(myDataReader)
'do something witht eh data?
For Each dr As DataRow In MyDataTable.Rows
Debug.Print(dr!name) ' [name] because i Know the column name from the query.
Next
Lowell