I have a table in MS SQL 2005 and I want pull a few fields from a table called MLBPlayers and I'm not sure how to write the syntax to dump these values from MS SQL Database to Listview control on a windows form. I got this far and then got stuck.
Public Class Form1
Shared WithEvents con As SqlConnection
Shared Sub Main()
con = New SqlConnection("Persist Security Info=False;User ID=sa;Password=50Cent;Initial Catalog=TSN2;Server=tsnappdev01")
Dim cmd As New SqlCommand()
cmd.CommandText = "SELECT FirstName, LastName, Position, Height , Weight FROM MLBPlayers"
cmd.Connection = con
Dim reader As SqlDataReader = cmd.ExecuteReader()
Loop While reader.NextResult()
Instead of console.write that's where the add Listview will go with Option Explict and Option Strict on. Thanks EE