Skip to content

Instantly share code, notes, and snippets.

@reu
Created June 16, 2010 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reu/440860 to your computer and use it in GitHub Desktop.
Save reu/440860 to your computer and use it in GitHub Desktop.
Dim Connection As New SqlConnection()
Dim Command As New SqlCommand()
Dim Result As SqlDataReader
Connection.ConnectionString = "Data Source=myserver;Initial Catalog=databasename;Integrated Security=True"
Connection.Open
Command.Connection = Connection
Command.CommandText = "SELECT * FROM users"
Result = Command.ExecuteReader
While Result.NextResult()
Result.Read()
MsgBox(Result("Column Name"))
End While
Result.Close
Connection.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment